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

makepromise

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makepromise - npm Package Compare versions

Comparing version 3.1.1 to 4.0.0

28

build/index.js
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 @@ }

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