Skip to content

Commit

Permalink
fix: apply logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed May 31, 2021
1 parent 8c1c08e commit 7fe5e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.ts
Expand Up @@ -120,7 +120,7 @@ function asyncParallelArray(
const arrLength = arr.length;

function count(errors: ValidateError[]) {
results.push(...errors);
results.push(...(errors || []));
total++;
if (total === arrLength) {
callback(results);
Expand Down Expand Up @@ -160,7 +160,7 @@ function asyncSerialArray(
function flattenObjArr(objArr: Record<string, RuleValuePackage[]>) {
const ret: RuleValuePackage[] = [];
Object.keys(objArr).forEach(k => {
ret.push(...objArr[k]);
ret.push(...(objArr[k] || []));
});
return ret;
}
Expand Down

0 comments on commit 7fe5e93

Please sign in to comment.