basePropertyDeep.js 476 B

12345678910111213141516171819
  1. var baseGet = require('./baseGet'),
  2. toPath = require('./toPath');
  3. /**
  4. * A specialized version of `baseProperty` which supports deep paths.
  5. *
  6. * @private
  7. * @param {Array|string} path The path of the property to get.
  8. * @returns {Function} Returns the new function.
  9. */
  10. function basePropertyDeep(path) {
  11. var pathKey = (path + '');
  12. path = toPath(path);
  13. return function(object) {
  14. return baseGet(object, path, pathKey);
  15. };
  16. }
  17. module.exports = basePropertyDeep;