mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
[node] Fix CommonJS import of module (#41225)
This commit is contained in:
1
types/node/module.d.ts
vendored
1
types/node/module.d.ts
vendored
@@ -16,4 +16,5 @@ declare module "module" {
|
||||
|
||||
constructor(id: string, parent?: Module);
|
||||
}
|
||||
export = Module;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Module } from 'module';
|
||||
import Module = require('module');
|
||||
import { URL } from 'url';
|
||||
require.extensions[".ts"] = () => "";
|
||||
|
||||
@@ -10,6 +10,7 @@ const m2: Module = new Module("moduleId");
|
||||
const b: string[] = Module.builtinModules;
|
||||
let paths: string[] = [];
|
||||
paths = m1.paths;
|
||||
m1 instanceof Module;
|
||||
|
||||
Module.createRequireFromPath('./test')('test');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user