File tree Expand file tree Collapse file tree 5 files changed +66
-0
lines changed
Expand file tree Collapse file tree 5 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ *
2+ ! ** /* .d.ts
3+ ! ** /* .d.cts
4+ ! ** /* .d.mts
5+ ! ** /* .d. * .ts
Original file line number Diff line number Diff line change 1+ /// <reference types="node" />
2+
3+ /**
4+ * Assert that argument are Exception
5+ */
6+ export function isErrnoException ( e : unknown ) : e is NodeJS . ErrnoException ;
Original file line number Diff line number Diff line change 1+ {
2+ "private" : true ,
3+ "name" : " @types/is-errno-exception" ,
4+ "version" : " 1.2.9999" ,
5+ "projects" : [
6+ " https://github.com/sosoba/is-errno-exception.git"
7+ ],
8+ "type" : " module" ,
9+ "exports" : " ./index.d.ts" ,
10+ "dependencies" : {
11+ "@types/node" : " *"
12+ },
13+ "devDependencies" : {
14+ "@types/is-errno-exception" : " workspace:."
15+ },
16+ "owners" : [
17+ {
18+ "name" : " Sławomir Osoba" ,
19+ "githubUsername" : " sosoba"
20+ },
21+ {
22+ "name" : " Borys Malinowski" ,
23+ "githubUsername" : " coigmalinowski"
24+ }
25+ ]
26+ }
Original file line number Diff line number Diff line change 1+ import { isErrnoException } from "is-errno-exception" ;
2+
3+ try {
4+ new URL ( "unknown" ) ;
5+ } catch ( e ) {
6+ if ( isErrnoException ( e ) && e . code === "ERR_MODULE_NOT_FOUND" ) {
7+ console . warn ( e . code . toLocaleUpperCase ( ) ) ;
8+ }
9+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "module" : " node16" ,
4+ "lib" : [
5+ " es6" ,
6+ " dom"
7+ ],
8+ "noImplicitAny" : true ,
9+ "noImplicitThis" : true ,
10+ "strictNullChecks" : true ,
11+ "strictFunctionTypes" : true ,
12+ "types" : [],
13+ "noEmit" : true ,
14+ "forceConsistentCasingInFileNames" : true
15+ },
16+ "files" : [
17+ " index.d.ts" ,
18+ " test/is-errno-exception.ts"
19+ ]
20+ }
You can’t perform that action at this time.
0 commit comments