makepromise
Advanced tools
Comparing version 3.1.1 to 4.0.0
let erotic = require('erotic'); if (erotic && erotic.__esModule) erotic = erotic.default; | ||
/** | ||
* @param {number} length | ||
* @param {number} i | ||
* @param {!Function} fn | ||
*/ | ||
function checkArgumentIndex(length, i, fn) { | ||
if (i > length - 2) { | ||
throw new Error(`Function${fn.name ? ` ${fn.name}` : ''} does not accept that many arguments (max ${length - 1} + callback).`) | ||
} | ||
} | ||
// /** | ||
// * @param {number} length | ||
// * @param {number} i | ||
// * @param {!Function} fn | ||
// */ | ||
// function checkArgumentIndex(length, i, fn) { | ||
// if (i > length - 2) { | ||
// throw new Error(`Function${fn.name ? ` ${fn.name}` : ''} does not accept that many arguments (max ${length - 1} + callback).`) | ||
// } | ||
// } | ||
@@ -43,8 +43,8 @@ /** | ||
if (Array.isArray(args)) { | ||
args.forEach((arg, i) => { | ||
checkArgumentIndex(fnLength, i, fn) | ||
}) | ||
// args.forEach((arg, i) => { | ||
// checkArgumentIndex(fnLength, i, fn) | ||
// }) | ||
allArgs = [...args, cb] | ||
} else if (Array.from(arguments).length > 1) { // args passed as a single argument, not array | ||
checkArgumentIndex(fnLength, 0, fn) | ||
// checkArgumentIndex(fnLength, 0, fn) | ||
allArgs = [args, cb] | ||
@@ -51,0 +51,0 @@ } |
## 3 February 2020 | ||
### [4.0.0](git+https://github.com/artdecocode/makepromise/compare/v3.1.1...v4.0.0) | ||
- [fix] Don't check for args length. | ||
### [3.1.0](git+https://github.com/artdecocode/makepromise/compare/v3.1.0...v3.1.1) | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "makepromise", | ||
"version": "3.1.1", | ||
"version": "4.0.0", | ||
"description": "Make a Promise from a function with a callback and preserve its error stack.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
import erotic from 'erotic' | ||
/** | ||
* @param {number} length | ||
* @param {number} i | ||
* @param {!Function} fn | ||
*/ | ||
function checkArgumentIndex(length, i, fn) { | ||
if (i > length - 2) { | ||
throw new Error(`Function${fn.name ? ` ${fn.name}` : ''} does not accept that many arguments (max ${length - 1} + callback).`) | ||
} | ||
} | ||
// /** | ||
// * @param {number} length | ||
// * @param {number} i | ||
// * @param {!Function} fn | ||
// */ | ||
// function checkArgumentIndex(length, i, fn) { | ||
// if (i > length - 2) { | ||
// throw new Error(`Function${fn.name ? ` ${fn.name}` : ''} does not accept that many arguments (max ${length - 1} + callback).`) | ||
// } | ||
// } | ||
@@ -43,8 +43,8 @@ /** | ||
if (Array.isArray(args)) { | ||
args.forEach((arg, i) => { | ||
checkArgumentIndex(fnLength, i, fn) | ||
}) | ||
// args.forEach((arg, i) => { | ||
// checkArgumentIndex(fnLength, i, fn) | ||
// }) | ||
allArgs = [...args, cb] | ||
} else if (Array.from(arguments).length > 1) { // args passed as a single argument, not array | ||
checkArgumentIndex(fnLength, 0, fn) | ||
// checkArgumentIndex(fnLength, 0, fn) | ||
allArgs = [args, cb] | ||
@@ -51,0 +51,0 @@ } |
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
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
12418