chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Check if an error is an AbortError.
|
||||
*
|
||||
* This handles both:
|
||||
* - Custom abort errors created with `new Error("AbortError")` (sets .message)
|
||||
* - Native Node.js AbortError from timers/promises (sets .name)
|
||||
*/
|
||||
export function isAbortError(error: unknown): boolean {
|
||||
return error instanceof Error && (error.name === "AbortError" || error.message === "AbortError");
|
||||
}
|
||||
Reference in New Issue
Block a user