@xylabs/threads
Advanced tools
Comparing version 3.3.2 to 3.3.3
@@ -142,3 +142,3 @@ /* eslint-disable unicorn/no-thenable */ | ||
eventSubscription.unsubscribe(); | ||
reject(Error('Pool has been terminated before task was run.')); | ||
reject(new Error('Pool has been terminated before task was run.')); | ||
} | ||
@@ -145,0 +145,0 @@ }); |
@@ -21,3 +21,3 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ | ||
const timeout = new Promise((resolve, reject) => { | ||
timeoutHandle = setTimeout(() => reject(Error(errorMessage)), timeoutInMs); | ||
timeoutHandle = setTimeout(() => reject(new Error(errorMessage)), timeoutInMs); | ||
}); | ||
@@ -56,3 +56,3 @@ const result = await Promise.race([promise, timeout]); | ||
const workerEvent = { | ||
error: Error(errorEvent.reason), | ||
error: new Error(errorEvent.reason), | ||
type: WorkerEventType.internalError, | ||
@@ -59,0 +59,0 @@ }; |
@@ -15,3 +15,3 @@ export function extendSerializer(extend, implementation) { | ||
deserialize(message) { | ||
return Object.assign(Error(message.message), { | ||
return Object.assign(new Error(message.message), { | ||
name: message.name, | ||
@@ -18,0 +18,0 @@ stack: message.stack, |
@@ -148,3 +148,3 @@ "use strict"; | ||
eventSubscription.unsubscribe(); | ||
reject(Error('Pool has been terminated before task was run.')); | ||
reject(new Error('Pool has been terminated before task was run.')); | ||
} | ||
@@ -151,0 +151,0 @@ }); |
@@ -27,3 +27,3 @@ "use strict"; | ||
const timeout = new Promise((resolve, reject) => { | ||
timeoutHandle = setTimeout(() => reject(Error(errorMessage)), timeoutInMs); | ||
timeoutHandle = setTimeout(() => reject(new Error(errorMessage)), timeoutInMs); | ||
}); | ||
@@ -62,3 +62,3 @@ const result = await Promise.race([promise, timeout]); | ||
const workerEvent = { | ||
error: Error(errorEvent.reason), | ||
error: new Error(errorEvent.reason), | ||
type: master_1.WorkerEventType.internalError, | ||
@@ -65,0 +65,0 @@ }; |
@@ -19,3 +19,3 @@ "use strict"; | ||
deserialize(message) { | ||
return Object.assign(Error(message.message), { | ||
return Object.assign(new Error(message.message), { | ||
name: message.name, | ||
@@ -22,0 +22,0 @@ stack: message.stack, |
{ | ||
"name": "@xylabs/threads", | ||
"version": "3.3.2", | ||
"version": "3.3.3", | ||
"description": "Web workers & worker threads as simple as a function call", | ||
@@ -81,3 +81,3 @@ "license": "MIT", | ||
"@types/execa": "^2.0.0", | ||
"@types/node": "^20.12.8", | ||
"@types/node": "^20.12.12", | ||
"@types/webpack": "^4.41.38", | ||
@@ -84,0 +84,0 @@ "ava": "^3.15.0", |
@@ -235,3 +235,3 @@ /* eslint-disable unicorn/no-thenable */ | ||
eventSubscription.unsubscribe() | ||
reject(Error('Pool has been terminated before task was run.')) | ||
reject(new Error('Pool has been terminated before task was run.')) | ||
} | ||
@@ -238,0 +238,0 @@ }) |
@@ -50,3 +50,3 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ | ||
const timeout = new Promise<never>((resolve, reject) => { | ||
timeoutHandle = setTimeout(() => reject(Error(errorMessage)), timeoutInMs) | ||
timeoutHandle = setTimeout(() => reject(new Error(errorMessage)), timeoutInMs) | ||
}) | ||
@@ -87,3 +87,3 @@ const result = await Promise.race([promise, timeout]) | ||
const workerEvent: WorkerInternalErrorEvent = { | ||
error: Error(errorEvent.reason), | ||
error: new Error(errorEvent.reason), | ||
type: WorkerEventType.internalError, | ||
@@ -90,0 +90,0 @@ } |
@@ -42,3 +42,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
deserialize(message: SerializedError): Error { | ||
return Object.assign(Error(message.message), { | ||
return Object.assign(new Error(message.message), { | ||
name: message.name, | ||
@@ -45,0 +45,0 @@ stack: message.stack, |
@@ -56,3 +56,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
const async = new ObservablePromise((observer) => { | ||
setTimeout(() => observer.error(Error('I am supposed to be rejected.')), 1) | ||
setTimeout(() => observer.error(new Error('I am supposed to be rejected.')), 1) | ||
}) | ||
@@ -127,3 +127,3 @@ | ||
setTimeout(() => observer.next(1), 10) | ||
setTimeout(() => observer.error(Error('Fails as expected.')), 20) | ||
setTimeout(() => observer.error(new Error('Fails as expected.')), 20) | ||
setTimeout(() => observer.next(2), 30) | ||
@@ -157,3 +157,3 @@ setTimeout(() => observer.complete(), 40) | ||
setTimeout(() => observer.next(1), 10) | ||
setTimeout(() => observer.error(Error('Fails as expected.')), 20) | ||
setTimeout(() => observer.error(new Error('Fails as expected.')), 20) | ||
setTimeout(() => observer.next(2), 30) | ||
@@ -188,3 +188,3 @@ setTimeout(() => observer.complete(), 40) | ||
const rejected = ObservablePromise.from(Promise.reject(Error('Fails'))) | ||
const rejected = ObservablePromise.from(Promise.reject(new Error('Fails'))) | ||
const error = await t.throwsAsync(rejected) | ||
@@ -191,0 +191,0 @@ |
@@ -75,3 +75,3 @@ /* eslint-disable require-await */ | ||
const testingError = Error('Test, test!') | ||
const testingError = new Error('Test, test!') | ||
@@ -78,0 +78,0 @@ subscription1.unsubscribe() |
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
290809