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

@js-bits/xpromise

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@js-bits/xpromise - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

10

index.js

@@ -46,5 +46,3 @@ import enumerate from '@js-bits/enumerate';

if (this[ø.executor]) {
const resolve = this.resolve.bind(this);
const reject = this.reject.bind(this);
this[ø.executor](resolve, reject, ...args);
this[ø.executor](this.resolve.bind(this), this.reject.bind(this), ...args);
this[ø.executor] = undefined;

@@ -61,3 +59,3 @@ }

this[ø.resolve](...args);
return this;
// return this; // don't do this
}

@@ -71,3 +69,5 @@

this[ø.reject](...args);
return this;
// returning anything can lead to a subsequent exceptions
// for cases like promise.catch(xpromise.reject.bind(xpromise))
// return this; // don't do this
}

@@ -74,0 +74,0 @@ }

@@ -83,4 +83,4 @@ /* eslint-disable max-classes-per-file */

});
test('should return the promise', () => {
expect(promise.resolve(123)).toBe(promise);
test('should return nothing', () => {
expect(promise.resolve(123)).toBeUndefined();
});

@@ -112,5 +112,5 @@ });

});
test('should return the promise', () => {
test('should return nothing', () => {
promise.catch(() => {});
expect(promise.reject(123)).toBe(promise);
expect(promise.reject(123)).toBeUndefined();
});

@@ -117,0 +117,0 @@ });

{
"name": "@js-bits/xpromise",
"version": "0.1.1",
"version": "0.1.2",
"description": "Extendable Promise",

@@ -5,0 +5,0 @@ "keywords": [

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