@linch90/od-validators
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published
  1. atLeastOne, at least one of the controls should satisfy the provided validator.
atLeastOne = (validator, controls: string[] | null) => ...
  1. atLeastOneConditionally, at least one of the controls should satisfy the provided validator if the dependedControl has the dependedValue.
atLeastOneConditionally = (
    validator: ValidatorFn,
    dependedControl: string,
    dependedValue: any,
    controls: string[] | null = null
  ) => ...
  1. requiredConditionally, make controls required, if the dependedControl has the dependedValue.
requiredConditionally = (
    dependedControl: string,
    dependedValue: any,
    controls: string[] | null = null
  ) => ...
  1. requiredConditionally2, make controls required, if the dependedControl has the dependedValue and the dependedControl2 has the dependedValue2.
requiredConditionally2 = (
  dependedControl: string, dependedValue: any) =>
  (
    dependedControl2: string,
    dependedValue2: any,
    controls: string[] | null = null
  ) => ...
  1. conditionalValidator, apply validator if predicate return true.
conditionalValidator =
  (predicate: () => boolean, validator: ValidatorFn) => ...

Package Sidebar

Install

npm i @linch90/od-validators

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

31.9 kB

Total Files

18

Last publish

Collaborators

  • linch90