Skip to content

Commit

Permalink
fix(validator): array schema f**ing issue!
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed May 3, 2023
1 parent 32635c6 commit f38a4a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/validator/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ export function validator<T extends StringifyableRecord>(
}
// else
const schema = itemSchema[0];
for (const index in itemValue) {
if (!Object.prototype.hasOwnProperty.call(itemSchema, index)) continue;
for (let index = itemValue.length - 1; index >= 0; index--) {
const item = itemValue[index];
targetObject[index] = validator<StringifyableRecord>(
itemValue[index] = validator<StringifyableRecord>(
schema,
item as StringifyableRecord, // @FIXME: DeMastmalize
additionalProperties,
Expand Down

0 comments on commit f38a4a5

Please sign in to comment.