API reference › @evolu/common › Type › SimplePassword
const SimplePassword: brand(
"SimplePassword",
/*#__PURE__*/ minLength(8)(/*#__PURE__*/ maxLength(64)(TrimmedString)),
);
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", %)