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

es6-promisify

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-promisify - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

20

dist/promisify.js

@@ -13,2 +13,14 @@ "use strict";

/**
* thatLooksLikeAPromiseToMe()
*
* Duck-types a promise.
*
* @param {object} o
* @return {bool} True if this resembles a promise
*/
function thatLooksLikeAPromiseToMe(o) {
return o && typeof o.then === "function" && typeof o.catch === "function";
}
/**
* promisify()

@@ -64,3 +76,9 @@ *

// Call the function
original.apply(that, args);
var response = original.apply(that, args);
// If it looks like original already returns a promise,
// then just resolve with that promise. Hopefully, the callback function we added will just be ignored.
if (thatLooksLikeAPromiseToMe(response)) {
resolve(response);
}
});

@@ -67,0 +85,0 @@ };

8

package.json
{
"name": "es6-promisify",
"version": "4.0.0",
"version": "4.1.0",
"description": "Converts callback-based functions to ES6 Promises",

@@ -14,3 +14,3 @@ "main": "dist/promisify.js",

"dependencies": {
"es6-promise": "^3.1.2"
"es6-promise": "^3.2.1"
},

@@ -31,8 +31,8 @@ "scripts": {

"devDependencies": {
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015": "^6.9.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"jslint": "^0.9.6",
"jslint": "^0.10.0",
"nodeunit": "^0.9.1"
}
}
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