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:1094

Exact length.

Example

// string & Brand<"Length1">
const Length1String = length(1)(String);

Type Parameters

Type Parameter
Exact extends number

Parameters

ParameterType
exactExact

Returns

BrandFactory<`Length${Exact}`, { length: number; }, LengthError<Exact>>

Was this page helpful?