New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

promise-callbacks

Package Overview
Dependencies
Maintainers
18
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-callbacks - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

1

CHANGELOG.md
## Release History
* 2.1.3 Fix delay, static exports, accept resolve value for async primitives
* 2.1.2 Fix for Node < 7
* 2.0.0 Replace sync with deferred, add promisify, fix asCallback
* 1.0.0 Initial release

2

package.json
{
"name": "promise-callbacks",
"version": "2.1.2",
"version": "2.1.3",
"description": "Utilities to help convert a callback-using codebase to promises.",

@@ -5,0 +5,0 @@ "engines": {

@@ -14,4 +14,6 @@ const { asCallback, patchPromise, unpatchPromise } = require('./asCallback');

promisifyAll: promisify.all,
withTimeout: static.withTimeout,
delay: static.delay
withTimeout: static.statics.withTimeout,
delay: static.statics.delay,
nextTick: static.statics.nextTick,
immediate: static.statics.immediate
};

@@ -32,4 +32,4 @@ const hasOwn = Object.prototype.hasOwnProperty;

// Instantiate the error here to capture a more useful stack trace.
const error = (message instanceof Error) ? message : new Error(message);
timeout = setTimeout(() => reject(error), delay);
const error = message instanceof Error ? message : new Error(message);
timeout = setTimeout(reject, delay, error);
});

@@ -45,12 +45,12 @@ return Promise.race([promise, timeoutPromise]).then((value) => {

function delay(time, ...args) {
return new Promise((resolve) => setTimeout(resolve, delay, ...args));
function delay(time, value) {
return new Promise((resolve) => setTimeout(resolve, time, value));
}
function nextTick(...args) {
return new Promise((resolve) => process.nextTick(resolve, ...args));
function nextTick(value) {
return new Promise((resolve) => process.nextTick(resolve, value));
}
function immediate(...args) {
return new Promise((resolve) => setImmediate(resolve, ...args));
function immediate(value) {
return new Promise((resolve) => setImmediate(resolve, value));
}

@@ -60,3 +60,8 @@

patchPromiseStatic,
unpatchPromiseStatic
unpatchPromiseStatic,
statics: {}
};
for (let fn of staticProperties) {
module.exports.statics[fn.name] = fn;
}
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