Skip to content

refine

DDataParser.checkerRefine(predicate, options?) creates a custom checker. It plugs in everywhere (schema.addChecker, checkers option, extended.refine API) and reuses the error engine (path, message, rejected value).

Interactive example

When to use it?

  • Validate a business pattern not covered by native checkers (IBAN, slug, etc.).
  • Centralize a reusable rule across multiple schemas (checkerRefine is a reusable value).
  • Express rules on complex structures (objects, tuples...) by relying on addChecker.

Additional examples

Validate coordinates

See also

Released under the MIT license.