Refactor getDeep method
This commit is contained in:
parent
6435ced707
commit
a8fa125a96
@ -730,7 +730,7 @@ const utils = {
|
|||||||
|
|
||||||
// Get a nested value in an object
|
// Get a nested value in an object
|
||||||
getDeep(object, path) {
|
getDeep(object, path) {
|
||||||
return path.split('.').reduce((obj, key) => (obj && obj[key]) || undefined, object);
|
return path.split('.').reduce((obj, key) => obj && obj[key], object);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Get the closest value in an array
|
// Get the closest value in an array
|
||||||
|
Loading…
x
Reference in New Issue
Block a user