Return undefined when the key is not present.

This commit is contained in:
Philip Giuliani
2018-05-30 17:10:38 +02:00
parent 94dc0d176c
commit 6435ced707
9 changed files with 14 additions and 14 deletions

6
dist/plyr.js vendored
View File

@ -1301,9 +1301,9 @@ var utils = {
// Get a nested value in an object
getDeep: function getDeep(object, value) {
return value.split('.').reduce(function (obj, key) {
return obj[key] || {};
getDeep: function getDeep(object, path) {
return path.split('.').reduce(function (obj, key) {
return obj && obj[key] || undefined;
}, object);
},