Skip to content

Commit c4c439f

Browse files
committed
fix: update isNodeJSErrnoException
1 parent 0100d4c commit c4c439f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export function escapeHtml(unsafe: string): string {
490490
* it has a .code property.
491491
*/
492492
export function isNodeJSErrnoException(error: unknown): error is NodeJS.ErrnoException {
493-
return error instanceof Error && (error as NodeJS.ErrnoException).code !== undefined
493+
return error !== undefined && (error as NodeJS.ErrnoException).code !== undefined
494494
}
495495

496496
// TODO: Replace with proper templating system.

0 commit comments

Comments
 (0)