This page is part of a static HTML representation of TriTarget.org at https://tritarget.org

composeValidators functor

Sukima14th September 2021 at 11:57pm
function composeValidators(...validators) {
  return function composedValidator(element) {
    return validators.reduce(
      (acc, validator) => [...acc, ...validator(element)],
      []
    );
  };
}