forked from microsoft/TypeScript
/
commonJSReexport.types
49 lines (39 loc) · 1.89 KB
/
commonJSReexport.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
=== tests/cases/conformance/salsa/main.js ===
const { hardline } = require('./second').nested;
>hardline : { type: string; }
>require('./second').nested : typeof import("tests/cases/conformance/salsa/first")
>require('./second') : { nested: typeof import("tests/cases/conformance/salsa/first"); }
>require : any
>'./second' : "./second"
>nested : typeof import("tests/cases/conformance/salsa/first")
hardline
>hardline : { type: string; }
=== tests/cases/conformance/salsa/first.js ===
// #41422, based on prettier's exports
const hardline = { type: "hard" }
>hardline : { type: string; }
>{ type: "hard" } : { type: string; }
>type : string
>"hard" : "hard"
module.exports = {
>module.exports = { hardline} : typeof import("tests/cases/conformance/salsa/first")
>module.exports : typeof import("tests/cases/conformance/salsa/first")
>module : { "\"tests/cases/conformance/salsa/first\"": typeof import("tests/cases/conformance/salsa/first"); }
>exports : typeof import("tests/cases/conformance/salsa/first")
>{ hardline} : { hardline: { type: string; }; }
hardline
>hardline : { type: string; }
}
=== tests/cases/conformance/salsa/second.js ===
module.exports = {
>module.exports = { nested: require('./first')} : { nested: typeof import("tests/cases/conformance/salsa/first"); }
>module.exports : { nested: typeof import("tests/cases/conformance/salsa/first"); }
>module : { "\"tests/cases/conformance/salsa/second\"": { nested: typeof import("tests/cases/conformance/salsa/first"); }; }
>exports : { nested: typeof import("tests/cases/conformance/salsa/first"); }
>{ nested: require('./first')} : { nested: typeof import("tests/cases/conformance/salsa/first"); }
nested: require('./first')
>nested : typeof import("tests/cases/conformance/salsa/first")
>require('./first') : typeof import("tests/cases/conformance/salsa/first")
>require : any
>'./first' : "./first"
};