API reference › @evolu/common › Type › maxLength
const maxLength: <Max>(max: Max) => BrandFactory<
`MaxLength${Max}`,
{
length: number;
},
MaxLengthError<Max>
>;
Defined in: packages/common/src/Type.ts:1361
Maximum length.
Use numeric literal, not expression. See BrandFactory.
Example
// string & Brand<"MaxLength100">
const String100 = maxLength(100)(String);