API reference / @evolu/common / Type / maxLength
Variable: maxLength()
const maxLength: <Max>(max) => BrandFactory<
`MaxLength${Max}`,
{
length: number;
},
MaxLengthError<Max>
>;
Defined in: packages/common/src/Type.ts:1067
Maximum length.
Example
// string & Brand<"MaxLength100">
const String100 = maxLength(100)(String);
Type Parameters
| Type Parameter |
|---|
Max extends number |
Parameters
| Parameter | Type |
|---|---|
max | Max |
Returns
BrandFactory<`MaxLength${Max}`, {
length: number;
}, MaxLengthError<Max>>