diff --git a/src/typebox.ts b/src/typebox.ts index 16673eb35..04a8f048c 100644 --- a/src/typebox.ts +++ b/src/typebox.ts @@ -56,6 +56,7 @@ export type Trim = T extends `${' '}${infer U}` ? Trim : T extends `${infe export type Assert = T extends E ? T : never export type Evaluate = T extends infer O ? { [K in keyof O]: O[K] } : never export type Ensure = T extends infer U ? U : never +export type EmptyString = '' // -------------------------------------------------------------------------- // Type Asserts // -------------------------------------------------------------------------- @@ -911,13 +912,13 @@ export type TTemplateLiteralConst = T extends TBoolean ? `${boolean}` : never // prettier-ignore -export type TTemplateLiteralUnion = +export type TTemplateLiteralUnion = T extends [infer L, ...infer R] ? `${TTemplateLiteralConst}${TTemplateLiteralUnion, Acc>}` : Acc export type TTemplateLiteralKeyRest = Assert>, TPropertyKey[]> export interface TTemplateLiteral extends TSchema { [Kind]: 'TemplateLiteral' - static: TTemplateLiteralUnion + static: TTemplateLiteralUnion type: 'string' pattern: string // todo: it may be possible to infer this pattern }