Documentation
    Preparing search index...

    Type Alias MinLength<Value>

    MinLength: tags.TagBase<
        {
            exclusive: true;
            kind: "minLength";
            schema: { minLength: Value };
            target: "string";
            validate: `${Value} <= $input.length`;
            value: Value;
        },
    >

    String minimum length constraint.

    MinLength<N> is a type tag that validates string values have at least the specified number of characters. Apply it to string properties using TypeScript intersection types.

    This constraint is commonly combined with MaxLength to define a valid length range. Multiple length constraints can be applied to the same property (all must pass).

    The constraint is enforced at runtime by typia.is(), typia.assert(), and typia.validate(). It generates minLength in JSON Schema output.

    Type Parameters

    • Value extends number

      Minimum number of characters required

    Jeongho Nam - https://github.com/samchon

    interface User {
    // Username must be at least 3 characters
    username: string & MinLength<3> & MaxLength<20>;
    // Password must be at least 8 characters
    password: string & MinLength<8>;
    }