Socket
Socket
Sign inDemoInstall

@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 1.0.10 to 1.0.11

5

dist/index.d.ts
export default ExtendablePromise;
export type Resolve<T> = (value: T | PromiseLike<T>, ...rest: unknown[]) => void;
export type Reject = (reason?: Error) => void;
export type ErrorName<T> = T extends `ExtendablePromise|${infer S}` ? `*|${S}` : never;
/**

@@ -54,6 +55,6 @@ * @template T

declare namespace ExtendablePromise {
const ExecutionError: "ExtendablePromise|ExecutionError";
const InstantiationError: "ExtendablePromise|InstantiationError";
const ExecutionError: "*|ExecutionError";
const InstantiationError: "*|InstantiationError";
}
import * as UniqueSymbols from '@js-bits/enumerate/types/unique-symbols';

@@ -13,2 +13,4 @@ import enumerate from '@js-bits/enumerate';

const ErrorPrefix = 'ExtendablePromise|';
const ERRORS = enumerate.ts(

@@ -19,3 +21,3 @@ `

`,
Prefix('ExtendablePromise|')
Prefix(ErrorPrefix)
);

@@ -123,6 +125,13 @@

/**
* @template T
* @typedef {T extends `${ErrorPrefix}${infer S}` ? `*|${S}`: never} ErrorName
*/
// Assigning properties one by one helps typescript to declare the namespace properly
ExtendablePromise.ExecutionError = ERRORS.ExecutionError;
ExtendablePromise.InstantiationError = ERRORS.InstantiationError;
ExtendablePromise.ExecutionError = /** @type {ErrorName<typeof ERRORS.ExecutionError>} */ (ERRORS.ExecutionError);
ExtendablePromise.InstantiationError = /** @type {ErrorName<typeof ERRORS.InstantiationError>} */ (
ERRORS.InstantiationError
);
export default ExtendablePromise;

2

package.json
{
"name": "@js-bits/xpromise",
"version": "1.0.10",
"version": "1.0.11",
"description": "Extendable Promise",

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

Sorry, the diff of this file is not supported yet

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