Comparing version 0.1.5 to 0.1.6
@@ -23,3 +23,2 @@ | ||
} else if (typeof Promise === 'function') { | ||
var set = require('function-name') | ||
var makeCallback = function(resolve, reject) { | ||
@@ -45,19 +44,14 @@ return function(err, value) { | ||
module.exports = function mz_promisify(name, fn) { | ||
set(anonymous, name) | ||
return anonymous | ||
function anonymous() { | ||
var len = arguments.length | ||
var args = new Array(len + 1) | ||
for (var i = 0; i < len; ++i) { | ||
args[i] = arguments[i] | ||
} | ||
var lastIndex = i | ||
return new Promise(function (resolve, reject) { | ||
args[lastIndex] = makeCallback(resolve, reject) | ||
fn.apply(null, args) | ||
}) | ||
} | ||
return eval('(function ' + name + '() {\n' | ||
+ 'var len = arguments.length\n' | ||
+ 'var args = new Array(len + 1)\n' | ||
+ 'for (var i = 0; i < len; ++i) args[i] = arguments[i]\n' | ||
+ 'var lastIndex = i\n' | ||
+ 'return new Promise(function (resolve, reject) {\n' | ||
+ 'args[lastIndex] = makeCallback(resolve, reject)\n' | ||
+ 'fn.apply(null, args)\n' | ||
+ '})\n' | ||
+ '})') | ||
} | ||
module.exports.bluebird = false | ||
} |
{ | ||
"name": "mz", | ||
"description": "modernize node.js to current ECMAScript standards", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": { | ||
@@ -13,5 +13,2 @@ "name": "Jonathan Ong", | ||
"repository": "normalize/mz", | ||
"optionalDependencies": { | ||
"function-name": "0" | ||
}, | ||
"devDependencies": { | ||
@@ -18,0 +15,0 @@ "bluebird": "1", |
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
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
0
6939
152
3