3.0.0 • Published 6 months ago

@linch90/od-validators v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago
  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) => ...
3.0.0

6 months ago

2.1.0

1 year ago

2.0.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago