Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asdfgh

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asdfgh - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

26

index.js

@@ -15,2 +15,3 @@ var defaultUrl =

return (loadScriptPromise = new Promise(function(resolve, reject) {
// create and attach zxcvbn script
var script = document.createElement("script");

@@ -29,8 +30,23 @@ script.type = "text/javascript";

document.getElementsByTagName("head")[0].appendChild(script);
setTimeout(function() {
reject({ message: "Timeout loading zxcvbn" });
}, loadTimeout);
}).then(null, function(error) {
// timeout and fallback for onload/onerror
var c = 0;
var hnd = setInterval(function(){
c++;
if (typeof zxcvbn === 'function') {
clearInterval(hnd);
return resolve(zxcvbn);
}
if (c * 100 > loadTimeout) {
clearInterval(hnd);
return reject(new Error('Timeout loading zxcvbn'));
}
}, 100);
}).then(function(zxcvbn) {
// remove heavy promise wrapper
return (loadScriptPromise = Promise.resolve(zxcvbn));
}, function(error) {
// when an error happens, clear the saved promise
loadScriptPromise = null;
reject(error);
throw error;
}));

@@ -37,0 +53,0 @@ }

2

package.json
{
"name": "asdfgh",
"version": "0.0.0",
"version": "0.0.1",
"description": "Asynchronous wrapper around zxcvbn",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc