Skip to content

Commit

Permalink
refactor: remove usage of _.isArray
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Mar 9, 2024
1 parent 9253922 commit 6a0c815
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/schema-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function validateArray(array, schema, current) {
* @return {Array<Object>} Found errors.
*/
function validate(obj, schema, current = []) {
return _.isArray(obj) ? validateArray(obj, schema, current) : validateObject(obj, schema, current);
return Array.isArray(obj) ? validateArray(obj, schema, current) : validateObject(obj, schema, current);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/schema-validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function isNil(value) {
* @return {boolean} `true` if `value` is an array, `false` otherwise.
*/
function isArray(value) {
return _.isArray(value);
return Array.isArray(value);
}

/**
Expand Down

0 comments on commit 6a0c815

Please sign in to comment.