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

promise-the-world

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

promise-the-world - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

mutex.js

@@ -17,2 +17,6 @@ const defer = require('./defer')

unlock () {
if (!this._lock) {
return
}
this._lock.resolve()

@@ -19,0 +23,0 @@ this._lock = null

2

package.json
{
"name": "promise-the-world",
"version": "1.0.0",
"version": "1.0.1",
"description": "A complete Promise utils collection",

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

@@ -57,3 +57,32 @@ const { strictEqual } = require('assert')

})
it('should do nothing if the mutex is not yet locked', async () => {
let error = null
const m = mutex()
try {
m.unlock()
} catch (err) {
error = err
}
strictEqual(error, null)
})
it('should do nothing if the mutex is already unlocked', async () => {
let error = null
const m = mutex()
await m.lock()
m.unlock()
try {
m.unlock()
} catch (err) {
error = err
}
strictEqual(error, null)
})
})
})
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