flatMorph in a type
I'm trying to use flatMorph to generate dynamic template literal keys for a type but it's becoming unknown.
The types are:
Why is
The types are:
Why is
a not preserving the type?const test = flatMorph(
Array.from({ length: 15 }, (_, i) => i + 1),
(i, v) => [`test_${i}` as const, 'string'],
);
const a = type(test)const test: {
[x: `test_${number}`]: string;
}
const a: Type<unknown, {}>a