Skip to content

Commit b7f794d

Browse files
committed
Fix custom resolver type
The custom resolver is allowed to return undefined (really, any falsy value) if a module is not found, but this type definition requires it to return a string. This fixes the definition to allow undefined.
1 parent 532120d commit b7f794d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface VMRequire {
2020
/** Collection of mock modules (both external or builtin). */
2121
mock?: any;
2222
/* An additional lookup function in case a module wasn't found in one of the traditional node lookup paths. */
23-
resolve?: (moduleName: string, parentDirname: string) => string;
23+
resolve?: (moduleName: string, parentDirname: string) => string | undefined;
2424
/** Custom require to require host and built-in modules. */
2525
customRequire?: (id: string) => any;
2626
}

0 commit comments

Comments
 (0)