|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
const asExpression = require("as-expression");
|
|
|
|
const asExpression = require("as-expression");
|
|
|
|
const defaultValue = require("default-value");
|
|
|
|
const defaultValue = require("default-value");
|
|
|
|
|
|
|
|
const assureArray = require("assure-array");
|
|
|
|
const flatten = require("flatten");
|
|
|
|
const flatten = require("flatten");
|
|
|
|
|
|
|
|
|
|
|
|
const ValidationError = require("@validatem/error");
|
|
|
|
const ValidationError = require("@validatem/error");
|
|
|
@ -15,7 +16,7 @@ function containsRules(rules) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// TODO: Switch to `Array#flat` once Node 10.x goes EOL (April 2021)
|
|
|
|
// TODO: Switch to `Array#flat` once Node 10.x goes EOL (April 2021)
|
|
|
|
let flattenedRules = flatten(rules);
|
|
|
|
let flattenedRules = flatten(assureArray(rules));
|
|
|
|
|
|
|
|
|
|
|
|
if (!flattenedRules.some((rule) => rule != null)) {
|
|
|
|
if (!flattenedRules.some((rule) => rule != null)) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|