Skip to content

Commit

Permalink
Github Rendering Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Nov 15, 2023
1 parent cbb4846 commit 983fde0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,15 +857,14 @@ export type TTemplateLiteralConst<T, Acc extends string> =
T extends TBigInt ? `${bigint}` :
T extends TBoolean ? `${boolean}` :
never
export type TTemplateLiteralUnionInitial = '' // resolves github rendering bug
// prettier-ignore
export type TTemplateLiteralUnion<T extends TTemplateLiteralKind[], Acc extends string = TTemplateLiteralUnionInitial> =
export type TTemplateLiteralUnion<T extends TTemplateLiteralKind[], Acc extends string> =
T extends [infer L, ...infer R] ? `${TTemplateLiteralConst<L, Acc>}${TTemplateLiteralUnion<Assert<R, TTemplateLiteralKind[]>, Acc>}` :
Acc
export type TTemplateLiteralKeyRest<T extends TTemplateLiteral> = Assert<UnionToTuple<Static<T>>, TPropertyKey[]>
export interface TTemplateLiteral<T extends TTemplateLiteralKind[] = TTemplateLiteralKind[]> extends TSchema {
[Kind]: 'TemplateLiteral'
static: TTemplateLiteralUnion<T>
static: TTemplateLiteralUnion<T, ''>
type: 'string'
pattern: string // todo: it may be possible to infer this pattern
}
Expand Down

0 comments on commit 983fde0

Please sign in to comment.