API reference / @evolu/common / Type / minLength

Variable: minLength()

const minLength: <Min>(min) => BrandFactory<
  `MinLength${Min}`,
  {
    length: number;
  },
  MinLengthError<Min>
>;

Defined in: packages/common/src/Type.ts:1036

Minimum length.

Example

// string & Brand<"MinLength1">
const NonEmptyString = minLength(1)(String);

Type Parameters

Type Parameter
Min extends number

Parameters

ParameterType
minMin

Returns

BrandFactory<`MinLength${Min}`, { length: number; }, MinLengthError<Min>>

Was this page helpful?