Skip to content

Commit

Permalink
fix: ensure that building arrays does not happen to objects with leng…
Browse files Browse the repository at this point in the history
…th prop closes #2398 (#2399)
  • Loading branch information
logaretm committed Oct 5, 2019
1 parent 89d9a51 commit f8d4e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validate.ts
Expand Up @@ -295,7 +295,7 @@ function _buildParams(

let definedRules: RuleParamConfig[];
// collect the params schema.
if (!defined || defined.length < provided.length) {
if (!defined || (defined.length < provided.length && Array.isArray(provided))) {
let lastDefinedParam: RuleParamConfig;
// collect any additional parameters in the last item.
definedRules = provided.map((_: any, idx: number) => {
Expand Down

0 comments on commit f8d4e42

Please sign in to comment.