Skip to content

Commit

Permalink
types: use local NodeModule type
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 3, 2024
1 parent 4207874 commit 718bea2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ interface NodeRequire {
/** @deprecated CommonJS API */
extensions: Record<
".js" | ".json" | ".node",
(m: Module, filename: string) => any | undefined
(m: NodeModule, filename: string) => any | undefined
>;

/** @deprecated CommonJS API */
main: Module | undefined;
main: NodeModule | undefined;
}

export interface NodeModule {
Expand Down
2 changes: 1 addition & 1 deletion src/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function evalModule(
true /* isNested */,
);

mod.require = _jiti;
mod.require = _jiti as typeof mod.require;

// @ts-ignore
mod.path = dirname(filename);
Expand Down
2 changes: 1 addition & 1 deletion src/jiti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function createJiti(
return pathToFileURL(resolved);
},
},
);
) as Jiti;

return jiti;
}

0 comments on commit 718bea2

Please sign in to comment.