Skip to content

Commit

Permalink
feat: added array support to getByPath
Browse files Browse the repository at this point in the history
  • Loading branch information
kouts committed May 11, 2021
1 parent 25ffb07 commit 7f48f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function splitPath(str) {
}

export function getByPath(obj, path) {
const parts = splitPath(path)
const parts = isArray(path) ? path : splitPath(path)
const length = parts.length
for (let i = 0; i < length; i++) {
if (typeof obj[parts[i]] === 'undefined') {
Expand Down

0 comments on commit 7f48f97

Please sign in to comment.