[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › minLength

```ts
function minLength<Min>(
  min: ValidateBrandFactoryNumber<Min>,
): BrandFactory<`MinLength${Min}`, ValueWithLength, MinLengthError<Min>>;
```

Defined in: [packages/common/src/Type.ts:5426](https://github.com/evoluhq/evolu/blob/59dabb7c56c68040b30d3919013adeb2b40bad10/packages/common/src/Type.ts#L5426)

Minimum-length [Brand](https://evolu.dev/docs/api-reference/common/Brand/interfaces/Brand) for values whose `length` is at least `min`.

### Example

```ts

const AtLeastThreeCharacters = minLength(3)(String);
const AtLeastTwoItems = minLength(2)(array(String));

assertOk(AtLeastThreeCharacters.fromUnknown("abc"), "abc");
assertOk(AtLeastTwoItems.fromUnknown(["a", "b"]), ["a", "b"]);
```