ValidBrand
ValidBrand<
S> =stringextendsS?S:Sextends`${infer _A extends LowerChar}${infer _B extends LowerChar}${infer _C extends LowerChar}`?S:never
Defined in: src/types.ts:43
Validator-style conditional type: resolves to S when S is exactly three
lowercase a–z characters, and to never otherwise.
When passed the generic string type it resolves to string, so existing
dynamic-brand call sites (e.g. CLI, ORM adapters) are unaffected.
Apply as a parameter intersection on codec constructors:
function createTimestampId<Brand extends string>(brand: Brand & ValidBrand<Brand>, ...)TypeScript then validates the specific brand literal at each call site without materialising the 17 576-member all-brands union.
Type Parameters
Section titled “Type Parameters”S extends string