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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
=== tests/cases/conformance/importAssertion/0.ts ===
export const a = 1;
>a : 1
>1 : 1
export const b = 2;
>b : 2
>2 : 2
=== tests/cases/conformance/importAssertion/1.ts ===
import './0' assert { type: "json" }
>type : any
import { a, b } from './0' assert { "type": "json" }
>a : 1
>b : 2
import * as foo from './0' assert { type: "json" }
>foo : typeof foo
>type : any
a;
>a : 1
b;
>b : 2
foo.a;
>foo.a : 1
>foo : typeof foo
>a : 1
foo.b;
>foo.b : 2
>foo : typeof foo
>b : 2
=== tests/cases/conformance/importAssertion/2.ts ===
import { a, b } from './0' assert {}
>a : 1
>b : 2
import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" }
>a : 1
>c : 1
>b : 2
>d : 2
>a : any
>b : any
>c : any
a;
>a : 1
b;
>b : 2
c;
>c : 1
d;
>d : 2
=== tests/cases/conformance/importAssertion/3.ts ===
const a = import('./0')
>a : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0') : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
const b = import('./0', { assert: { type: "json" } })
>b : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', { assert: { type: "json" } }) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{ assert: { type: "json" } } : { assert: { type: string; }; }
>assert : { type: string; }
>{ type: "json" } : { type: string; }
>type : string
>"json" : "json"
const c = import('./0', { assert: { type: "json", ttype: "typo" } })
>c : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', { assert: { type: "json", ttype: "typo" } }) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{ assert: { type: "json", ttype: "typo" } } : { assert: { type: string; ttype: string; }; }
>assert : { type: string; ttype: string; }
>{ type: "json", ttype: "typo" } : { type: string; ttype: string; }
>type : string
>"json" : "json"
>ttype : string
>"typo" : "typo"
const d = import('./0', { assert: {} })
>d : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', { assert: {} }) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{ assert: {} } : { assert: {}; }
>assert : {}
>{} : {}
const dd = import('./0', {})
>dd : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', {}) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{} : {}
declare function foo(): any;
>foo : () => any
const e = import('./0', foo())
>e : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', foo()) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>foo() : any
>foo : () => any
const f = import()
>f : Promise<any>
>import() : Promise<any>
const g = import('./0', {}, {})
>g : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', {}, {}) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{} : {}
>{} : {}
const h = import('./0', { assert: { type: "json" }},)
>h : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>import('./0', { assert: { type: "json" }},) : Promise<typeof import("tests/cases/conformance/importAssertion/0")>
>'./0' : "./0"
>{ assert: { type: "json" }} : { assert: { type: string; }; }
>assert : { type: string; }
>{ type: "json" } : { type: string; }
>type : string
>"json" : "json"
|