Skip to content

Commit 718bea2

Browse files
committedOct 3, 2024
types: use local NodeModule type
1 parent 4207874 commit 718bea2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎lib/types.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ interface NodeRequire {
181181
/** @deprecated CommonJS API */
182182
extensions: Record<
183183
".js" | ".json" | ".node",
184-
(m: Module, filename: string) => any | undefined
184+
(m: NodeModule, filename: string) => any | undefined
185185
>;
186186

187187
/** @deprecated CommonJS API */
188-
main: Module | undefined;
188+
main: NodeModule | undefined;
189189
}
190190

191191
export interface NodeModule {

‎src/eval.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function evalModule(
109109
true /* isNested */,
110110
);
111111

112-
mod.require = _jiti;
112+
mod.require = _jiti as typeof mod.require;
113113

114114
// @ts-ignore
115115
mod.path = dirname(filename);

‎src/jiti.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default function createJiti(
163163
return pathToFileURL(resolved);
164164
},
165165
},
166-
);
166+
) as Jiti;
167167

168168
return jiti;
169169
}

0 commit comments

Comments
 (0)
Please sign in to comment.