@azlib/validator
v0.2.0
Published
Dependency-light validation and string normalization helpers.
Downloads
91
Readme
Validator
Dependency-light validation and string normalization helpers.
import { assertValid, createRule, isEmail, isPresent } from "@azlib/validator";
const required = createRule("required", ({ normalizedValue }) => isPresent(normalizedValue));
const email = createRule("email", ({ value }) => isEmail(value));
assertValid("[email protected]", [required, email]);Named exports are also available through the frozen validator facade for consumers that prefer a single object import.
