@js-bits/xpromise
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -19,12 +19,2 @@ export default ExtendablePromise; | ||
/** | ||
* @type {'ExtendablePromise|InstantiationError'} | ||
* @readonly | ||
*/ | ||
static readonly InstantiationError: 'ExtendablePromise|InstantiationError'; | ||
/** | ||
* @type {'ExtendablePromise|ExecutionError'} | ||
* @readonly | ||
*/ | ||
static readonly ExecutionError: 'ExtendablePromise|ExecutionError'; | ||
/** | ||
* Creates new `ExtendablePromise` instance. | ||
@@ -64,3 +54,7 @@ * @param {(resolve:Resolve<T>, reject:Reject, ...rest:unknown[]) => void} executor - A function to be executed by the `.execute()` method | ||
} | ||
declare namespace ExtendablePromise { | ||
const ExecutionError: "ExtendablePromise|ExecutionError"; | ||
const InstantiationError: "ExtendablePromise|InstantiationError"; | ||
} | ||
import * as UniqueSymbols from '@js-bits/enumerate/types/unique-symbols'; |
16
index.js
@@ -38,14 +38,2 @@ import enumerate from '@js-bits/enumerate'; | ||
/** | ||
* @type {'ExtendablePromise|InstantiationError'} | ||
* @readonly | ||
*/ | ||
static InstantiationError = ERRORS.InstantiationError; | ||
/** | ||
* @type {'ExtendablePromise|ExecutionError'} | ||
* @readonly | ||
*/ | ||
static ExecutionError = ERRORS.ExecutionError; | ||
/** | ||
* Creates new `ExtendablePromise` instance. | ||
@@ -134,2 +122,6 @@ * @param {(resolve:Resolve<T>, reject:Reject, ...rest:unknown[]) => void} executor - A function to be executed by the `.execute()` method | ||
// Assigning properties one by one helps typescript to declare the namespace properly | ||
ExtendablePromise.ExecutionError = ERRORS.ExecutionError; | ||
ExtendablePromise.InstantiationError = ERRORS.InstantiationError; | ||
export default ExtendablePromise; |
@@ -35,3 +35,3 @@ /* eslint-disable max-classes-per-file, import/no-extraneous-dependencies, no-unused-vars */ | ||
test('should throw a sync error', () => { | ||
expect.assertions(3); | ||
expect.assertions(4); | ||
promise = undefined; | ||
@@ -42,2 +42,3 @@ try { | ||
expect(error.name).toEqual('ExtendablePromise|InstantiationError'); | ||
expect(error.name).toEqual(ExtendablePromise.InstantiationError); | ||
expect(error.message).toEqual('Invalid executor type: null'); | ||
@@ -44,0 +45,0 @@ } |
{ | ||
"name": "@js-bits/xpromise", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Extendable Promise", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27832
725