API reference@evolu/commonType › trimmed

const trimmed: BrandFactory<"Trimmed", string, TrimmedError>;

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

Trimmed string.

This Type Factory validates whether a string has no leading or trailing whitespaces.

Example

const TrimmedNonEmptyString = trimmed(minLength(1)(String));
// string & Brand<"MinLength1"> & Brand<"Trimmed">
type TrimmedNonEmptyString = typeof TrimmedNonEmptyString.Type;