Skip to content

Commit

Permalink
fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
a4elru committed Aug 1, 2023
1 parent 36d5aa6 commit d7870bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function compareWithRuleType(actual, expected, rules, regex_rules, path, rule) {
if (actual.length < rule.min) {
throw `Json doesn't have 'array' with min length of '${rule.min}' at '${path}' but found 'array' with length '${actual.length}'`;
}
if (typeof expected[0] !== 'undefined') {
if (rule.min > 0 || typeof expected[0] !== 'undefined') {
for (let i = 0; i < actual.length; i++) {
_compare(actual[i], expected[0], rules, regex_rules, `${path}[${i}]`);
}
Expand Down

0 comments on commit d7870bb

Please sign in to comment.