valirator
Version:
Powerful javascript by schema validation tool
15 lines (12 loc) • 333 B
JavaScript
import { castArray } from '../utils';
/**
*
* @param value
* @param notMatchTo
* @returns {*}
*/
export default function notMatchToRule(value, notMatchTo) {
return castArray(notMatchTo).every(not => not !== value);
}
notMatchToRule.ruleName = 'notMatchTo';
notMatchToRule.defaultMessage = 'should not match to %{expected}';