Spaces:
Paused
Paused
Download node_modules/msw/src/node/utils/isNodeExceptionLike.ts from sam522/GenAI_Course: direct link, hf CLI and curl.
- Browser
- Download file 472 Bytes
-
https://huggingface.co/spaces/sam522/GenAI_Course/resolve/ca55ba5cae4dfcc523bdfd04453a4162c0091df2/node_modules/msw/src/node/utils/isNodeExceptionLike.ts
- Command line
-
hf download hf://spaces/sam522/GenAI_Course@ca55ba5cae4dfcc523bdfd04453a4162c0091df2/node_modules/msw/src/node/utils/isNodeExceptionLike.ts
-
curl -L -o isNodeExceptionLike.ts https://huggingface.co/spaces/sam522/GenAI_Course/resolve/ca55ba5cae4dfcc523bdfd04453a4162c0091df2/node_modules/msw/src/node/utils/isNodeExceptionLike.ts
472 Bytes
| /** | |
| * 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 | |
| } | |