-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/use-vitest
- Loading branch information
Showing
3 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Determines if the given value is shaped like a Node.js exception. | ||
* Node.js exceptions have additional information, like | ||
* the `code` and `errno` properties. | ||
* | ||
* In some environments, particularly jsdom/jest these may not | ||
* instances of `Error` or its subclasses, despite being similar | ||
* to them. | ||
*/ | ||
export function isNodeExceptionLike( | ||
error: unknown, | ||
): error is NodeJS.ErrnoException { | ||
return !!error && typeof error === 'object' && 'code' in error | ||
} |