@jsenv/abort
Advanced tools
Comparing version 4.0.0 to 4.1.0
{ | ||
"name": "@jsenv/abort", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Help to write code compatible with abort signals", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -16,2 +16,11 @@ /* | ||
}, | ||
throwIfAborted: (signal) => { | ||
if (signal.aborted) { | ||
const error = new Error(`The operation was aborted`) | ||
error.name = "AbortError" | ||
error.type = "aborted" | ||
throw error | ||
} | ||
}, | ||
} | ||
@@ -46,8 +55,3 @@ | ||
const throwIfAborted = () => { | ||
if (operationSignal.aborted) { | ||
const error = new Error(`The operation was aborted`) | ||
error.name = "AbortError" | ||
error.type = "aborted" | ||
throw error | ||
} | ||
Abort.throwIfAborted(operationSignal) | ||
} | ||
@@ -54,0 +58,0 @@ |
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
20479
457