Skip to content

Commit eda5d24

Browse files
🤖 Merge PR DefinitelyTyped#71493 [@types/node] correct ResolveFnOutput.format (can be intermediary) by @JakobJingleheimer
Co-authored-by: René <[email protected]>
1 parent 895cfb8 commit eda5d24

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎types/node/module.d.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ declare module "module" {
325325
}
326326
interface ResolveFnOutput {
327327
/**
328-
* A hint to the load hook (it might be ignored)
328+
* A hint to the load hook (it might be ignored); can be an intermediary value.
329329
*/
330-
format?: ModuleFormat | null | undefined;
330+
format?: string | null | undefined;
331331
/**
332332
* The import attributes to use when caching the module (optional; if excluded the input will be used)
333333
*/
@@ -365,9 +365,9 @@ declare module "module" {
365365
*/
366366
conditions: string[];
367367
/**
368-
* The format optionally supplied by the `resolve` hook chain
368+
* The format optionally supplied by the `resolve` hook chain (can be an intermediary value).
369369
*/
370-
format: ModuleFormat | null | undefined;
370+
format: string | null | undefined;
371371
/**
372372
* An object whose key-value pairs represent the assertions for the module to import
373373
*/

‎types/node/test/module.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Module.Module === Module;
191191
const load: Module.LoadHook = async (url, context, nextLoad) => {
192192
const { format } = context;
193193

194-
if (format) {
194+
if (format === 'commonjs') { // Needs to match only sometimes
195195
return {
196196
format,
197197
shortCircuit: true,

0 commit comments

Comments
 (0)