|
|
|
@ -4,6 +4,7 @@ const assureArray = require("assure-array");
|
|
|
|
|
const isPlainObj = require("is-plain-obj");
|
|
|
|
|
const defaultValue = require("default-value");
|
|
|
|
|
const flat = require("array.prototype.flat");
|
|
|
|
|
const flatMap = require("array.prototype.flatmap");
|
|
|
|
|
|
|
|
|
|
const matchSpecial = require("@validatem/match-special");
|
|
|
|
|
const isPlainObjectValidator = require("@validatem/is-plain-object");
|
|
|
|
@ -19,7 +20,7 @@ module.exports = function normalizeRules(rules, options) {
|
|
|
|
|
let actualRules = flattened.filter((rule) => rule != null);
|
|
|
|
|
|
|
|
|
|
if (normalizeObjects) {
|
|
|
|
|
return actualRules.flatMap((rule) => {
|
|
|
|
|
return flatMap(actualRules, (rule) => {
|
|
|
|
|
if (isPlainObj(rule) && !matchSpecial(rule)) {
|
|
|
|
|
return [
|
|
|
|
|
isPlainObjectValidator,
|
|
|
|
|