API reference / @evolu/common / Type / length
Variable: length()
const length: <Exact>(exact) => BrandFactory<
`Length${Exact}`,
{
length: number;
},
LengthError<Exact>
>;
Defined in: packages/common/src/Type.ts:1097
Exact length.
Example
// string & Brand<"Length1">
const Length1String = length(1)(String);
Type Parameters
Type Parameter |
---|
Exact extends number |
Parameters
Parameter | Type |
---|---|
exact | Exact |
Returns
BrandFactory
<`Length${Exact}`
, {
length
: number
;
}, LengthError
<Exact
>>