const lines = ['one', 'two', 'three'] as const;
const linesWithA = lines.map(line => `${line}-A` as const);
const linesWithB = lines.map(line => `${line.toUpperCase()}-B` as const);
donnera des types :
declare const lines: readonly ["one", "two", "three"];
declare const linesWithA: ("one-A" | "two-A" | "three-A")[];
declare const linesWithB: `${string}-B`[];
Est-il possible d'obtenir un type pour linesWithB sous forme de ("ONE-B" | "TWO-B" | "THREE-B")[]
? Je reçois `${string}-A`[]
au lieu de cela, à cause de la toUpperCase
appeler.