javascript to typescript converter online

Solutions on MaxInterview for javascript to typescript converter online by the best coders in the world

showing results for - "javascript to typescript converter online"
Nils
26 Jun 2020
1function parseJwt(token) {
2    var base64Payload = token.split('.')[1];
3    var payload = Buffer.from(base64Payload, 'base64');
4    return JSON.parse(payload.toString());
5  }
Lucia
10 Feb 2020
1function setaPlanos() {
2    let input = document.getElementById("planosInput");
3    for (plano of PLANOS) {
4      let option = document.createElement("option");
5      option.innerHTML = plano.descricao;
6      option.value = PLANOS.indexOf(plano);
7      input.appendChild(option);
8    }
9  }
Johanna
08 Sep 2019
1$('.digit-group').find('input').each(function() {
2	$(this).attr('maxlength', 1);
3	$(this).on('keyup', function(e) {
4		var parent = $($(this).parent());
5		
6		if(e.keyCode === 8 || e.keyCode === 37) {
7			var prev = parent.find('input#' + $(this).data('previous'));
8			
9			if(prev.length) {
10				$(prev).select();
11			}
12		} else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) {
13			var next = parent.find('input#' + $(this).data('next'));
14			
15			if(next.length) {
16				$(next).select();
17			} else {
18				if(parent.data('autosubmit')) {
19					parent.submit();
20				}
21			}
22		}
23	});
24});
Leonardo
25 May 2020
1function setaPlanos() {
2    let input = document.getElementById("planosInput");
3    for (plano of PLANOS) {
4      let option = document.createElement("option");
5      option.innerHTML = plano.descricao;
6      option.value = PLANOS.indexOf(plano);
7      input.appendChild(option);
8    }
9  }
Marie
12 Apr 2018
1function signOut() {
2    var auth2 = gapi.auth2.getAuthInstance();
3    auth2.signOut().then(function () {
4      console.log('User signed out.');
5    });
6  }
Caterina
01 Apr 2017
1 const  Validacao =() => {
2     const {getFieldProps, handleSubmit, isValid} = useFormik({
3        initialValues: {
4            name:'',
5            contact:{
6            email:'',
7            phone:''
8        }
9       },
10       validate: values => {
11        const err ={}
12        const message= ' campo obrigatorio'
13        if(!values.name) err.name = message
14        if(!values.contact.email) err.email = message
15        return err
16    },
17    onSubmit: (values, bag) => {
18    console.log(values)
19  }
20})
21const [name, metadataName] = getFieldProps('name','text')
22const [email, metadataEmail] = getFieldProps('contact.email', 'text')
23const [phone, metadataPhone] = getFieldProps('contact.phone', 'text')