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

promisize

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promisize - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

package.json
{
"name": "promisize",
"version": "1.1.1",
"version": "1.1.2",
"description": "Easily support both callbacks and promises in your js lib",

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

"devDependencies": {
"standard": "^9.0.2",
"standard": "^10.0.2",
"tape": "^4.6.3"
}
}

@@ -19,6 +19,6 @@ var promisize = require('.')

t.equal(cb.promise, undefined)
cb('error')
cb(new Error('error'))
function callback (err, result) {
t.equal(err, 'error')
t.ok(err instanceof Error)
t.equal(result, undefined)

@@ -46,9 +46,21 @@ t.end()

cb.promise.catch(function (err) {
t.equal(err, 'error')
t.ok(err instanceof Error)
t.end()
})
cb('error')
cb(new Error('error'))
})
test('call callback before promise.then', function (t) {
var cb = promisize(undefined)
t.notEqual(cb.promise, undefined)
cb(null, 'foobar')
cb.promise.then(function (result) {
t.equal(result, 'foobar')
t.end()
})
})
// ********************************************************************

@@ -84,6 +96,6 @@ // ***** Pretend there is no native Promise support from here on ******

t.equal(cb.promise, undefined)
cb('error')
cb(new Error('error'))
function callback (err, result) {
t.equal(err, 'error')
t.ok(err instanceof Error)
t.equal(result, undefined)

@@ -90,0 +102,0 @@ t.end()

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