Comparing version 1.0.0 to 1.0.1
16
index.js
@@ -1,9 +0,9 @@ | ||
function lockify(f) { | ||
var lock = Promise.resolve() | ||
return function () { | ||
var params = [].slice.apply(arguments) | ||
var result = | ||
lock.then(function () { return f.apply(undefined, params) }) | ||
lock = result.catch(function () {}) | ||
return result | ||
const lockify = f => { | ||
let lock = Promise.resolve() | ||
return (...params) => { | ||
const result = lock.then(() => f(...params)) | ||
lock = result.catch(() => {}) | ||
return result.then(value => value) | ||
} | ||
@@ -10,0 +10,0 @@ } |
{ | ||
"name": "lockify", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "If your promise-returning function can't run concurrently, lockify it!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
989
9
1