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);
will give types:
declare const lines: readonly ["one", "two", "three"];
declare const linesWithA: ("one-A" | "two-A" | "three-A")[];
declare const linesWithB: `${string}-B`[];
Is it somehow possible to get a type for linesWithB as ("ONE-B" | "TWO-B" | "THREE-B")[]? I'm getting `${string}-A`[] instead, becaue of the toUpperCase call.