Socket
Socket
Sign inDemoInstall

p-cancelable

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

12

index.js

@@ -40,3 +40,3 @@ export class CancelError extends Error {

resolve(value);
this.#state = promiseState.resolved;
this.#setState(promiseState.resolved);
}

@@ -48,3 +48,3 @@ };

reject(error);
this.#state = promiseState.rejected;
this.#setState(promiseState.rejected);
}

@@ -92,3 +92,3 @@ };

this.#state = promiseState.canceled;
this.#setState(promiseState.canceled);

@@ -114,4 +114,10 @@ if (this.#cancelHandlers.length > 0) {

}
#setState(state) {
if (this.#state === promiseState.pending) {
this.#state = state;
}
}
}
Object.setPrototypeOf(PCancelable.prototype, Promise.prototype);
{
"name": "p-cancelable",
"version": "4.0.0",
"version": "4.0.1",
"description": "Create a promise that can be canceled",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc