flatMorph in a type

I'm trying to use flatMorph to generate dynamic template literal keys for a type but it's becoming unknown.

const test = flatMorph(
  Array.from({ length: 15 }, (_, i) => i + 1),
  (i, v) => [`test_${i}` as const, 'string'],
);
const a = type(test)


The types are:

const test: {
    [x: `test_${number}`]: string;
}

const a: Type<unknown, {}>


Why is a not preserving the type?
Was this page helpful?