parameter
parameter copied to clipboard
Can't validate Array
const arr = [{ key: ' ' }];
const rules = {};
validate(rules, arr);
No matter how to set the rule can not validate the array
You can wrap array to a object, then pass it to parameter https://github.com/node-modules/parameter#array
Of course you could wrap everything into an object as a "work around", but this somehow makes options.validateRoot default to false a little confusing and misleading: by giving an impression that it could validate something other than objects, such as arrays.