Answers for "convert js to ts"

0

convert js to ts

case '/local/forgot':
         if( req.method==='POST' ) {
            const email=req.body.email.toLowerCase();
             return server.get_user_by_email( email ).then ( p => {
                 if ( p ) {
                     server.push_token( p, common.get_uuid() );
                     return res.redirect(`/auth/local/email_sent?email=${email}`);
                 }
                 else

                     return res.redirect(`/auth/local/forgot`);
             });
         }
Posted by: Guest on October-08-2021
0

convert js to ts

update_password( password, user_token ) {
         this.mongodb.collection( "users" ).updateOne( { [`password_recovery_tokens.${user_token}`]: {$exists: true}  }, {$set : { password : crypto.createHash('sha256').update(password).digest('base64') } } )
     }
Posted by: Guest on October-08-2021
0

convert js to ts

var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
  acc[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var panel = this.nextElementSibling;
    if (panel.style.display === "block") {
      panel.style.display = "none";
    } else {
      panel.style.display = "block";
    }
  });
}
Posted by: Guest on August-09-2021
0

convert js to ts

case '/local/forgot':
         if( req.method==='POST' ) {
             const email=req.body.email.toLowerCase();
             return server.get_user_by_email( email ).then ( p => {
                 if ( p ) {
                     server.push_token( p, common.get_uuid() );
                     return res.redirect(`/auth/local/email_sent?email=${email}`);
                 }
                 else

                     return res.redirect(`/auth/local/forgot`);
             });
         }
Posted by: Guest on October-08-2021
0

convert js to ts

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
Posted by: Guest on October-07-2021
0

convert js to ts

update_password( password, user_token ) {
         this.mongodb.collection( "users" ).updateOne( { [`password_recovery_tokens.${user_token}`]: {$exists: true}  }, {$set : { password : crypto.createHash('sha256').update(password).digest('base64') } } )
     }
Posted by: Guest on October-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language