From e38672cd3e38f759708d7bd5a3a520559f431d33 Mon Sep 17 00:00:00 2001 From: glmdgrielson <32415403+glmdgrielson@users.noreply.github.com> Date: Sun, 4 Feb 2018 18:13:44 -0500 Subject: [PATCH] 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. --- types/node/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 38f043554b..5d4a3d54c3 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -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;