mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-03-02 04:32:55 +00:00
[node] Fix CommonJS import of module (#41225)
This commit is contained in:
parent
8b6f65181d
commit
c08d2b5e4a
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');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user