API reference › @evolu/common › Type › 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;