Skip to content

Commit

Permalink
Merge pull request #62 from TylerRick/fix_getValues_for_array
Browse files Browse the repository at this point in the history
Use Object.entries instead of for鈥n to iterate over arrays
  • Loading branch information
larrybotha committed Nov 19, 2020
2 parents 54ec0d9 + fdeaf83 commit facf04d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util.js
Expand Up @@ -27,9 +27,9 @@ function isEmpty(object) {

function getValues(object) {
let result = [];
for (const key in object) {
for (const [, value] of Object.entries(object)) {
result = result.concat(
typeof object[key] === 'object' ? getValues(object[key]) : object[key],
typeof value === 'object' ? getValues(value) : value,
);
}
return result;
Expand Down

0 comments on commit facf04d

Please sign in to comment.