Here is the code I am working with:
type CustomType<T extends string = string> = `custom-${T}-type`;
const value: CustomType = 'custom-example-type';
The code above functions as expected, but it does not enforce the expected structure. The following code is also accepted:
const value: CustomType = 'custom--type';
How can I ensure that the T
parameter is utilized?