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
|
=== tests/cases/compiler/templateLiteralIntersection3.ts ===
type Path = string & { _pathBrand: any };
>Path : string & { _pathBrand: any; }
>_pathBrand : any
declare const path: Path;
>path : Path
declare const options1: { prop: number; } & { [k: string]: boolean; };
>options1 : { prop: number; } & { [k: string]: boolean; }
>prop : number
>k : string
options1[`foo`] = false;
>options1[`foo`] = false : false
>options1[`foo`] : boolean
>options1 : { prop: number; } & { [k: string]: boolean; }
>`foo` : "foo"
>false : false
options1[`foo/${path}`] = false;
>options1[`foo/${path}`] = false : false
>options1[`foo/${path}`] : boolean
>options1 : { prop: number; } & { [k: string]: boolean; }
>`foo/${path}` : `foo/${Path}`
>path : Path
>false : false
// Lowercase<`foo/${Path}`> => `foo/${Lowercase<Path>}`
declare const lowercasePath: Lowercase<`foo/${Path}`>;
>lowercasePath : `foo/${Lowercase<`${Path}`>}`
options1[lowercasePath] = false;
>options1[lowercasePath] = false : false
>options1[lowercasePath] : boolean
>options1 : { prop: number; } & { [k: string]: boolean; }
>lowercasePath : `foo/${Lowercase<`${Path}`>}`
>false : false
|