API reference › @evolu/common › Type › SimplePassword
type SimplePassword = string &
Brand<"Trimmed"> &
Brand<"MaxLength64"> &
Brand<"MinLength8"> &
Brand<"SimplePassword">;
Defined in: packages/common/src/Type.ts:1701
Trimmed string between 8 and 64 characters, branded as SimplePassword.
Take a look how SimplePassword is defined:
export const SimplePassword = brand(
"SimplePassword",
minLength(8)(maxLength(64)(TrimmedString)),
);
Nested functions are often OK (if not, make a helper), but with TC39 Hack pipes it would be clearer:
// TrimmedString
// |> minLength(8)(%)
// |> maxLength(64)(%)
// |> brand("SimplePassword", %)