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

lockify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lockify - npm Package Compare versions

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",

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