Updated require.resolve

The official `require.resolve` docs say that it now accepts a second argument, an object with a paths property is an array which I think is comprised of strings.
This commit is contained in:
glmdgrielson
2018-02-04 18:13:44 -05:00
committed by GitHub
parent 8058968995
commit e38672cd3e
+6 -1
View File
@@ -118,12 +118,17 @@ interface NodeRequireFunction {
}
interface NodeRequire extends NodeRequireFunction {
resolve(id: string): string;
resolve: RequireResolve;
cache: any;
extensions: NodeExtensions;
main: NodeModule | undefined;
}
interface RequireResolve {
(id: string, options?: { paths: string[]; }): string;
paths(request: string): string[];
}
interface NodeExtensions {
'.js': (m: NodeModule, filename: string) => any;
'.json': (m: NodeModule, filename: string) => any;