20 lines
476 B
JavaScript
20 lines
476 B
JavaScript
var baseGet = require('./baseGet'),
|
|
toPath = require('./toPath');
|
|
|
|
/**
|
|
* A specialized version of `baseProperty` which supports deep paths.
|
|
*
|
|
* @private
|
|
* @param {Array|string} path The path of the property to get.
|
|
* @returns {Function} Returns the new function.
|
|
*/
|
|
function basePropertyDeep(path) {
|
|
var pathKey = (path + '');
|
|
path = toPath(path);
|
|
return function(object) {
|
|
return baseGet(object, path, pathKey);
|
|
};
|
|
}
|
|
|
|
module.exports = basePropertyDeep;
|