MCPcopy
hub / github.com/lodash/lodash / safeGet

Function safeGet

lodash.js:6704–6714  ·  view source on GitHub ↗

* Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value.

(object, key)

Source from the content-addressed store, hash-verified

6702 * @returns {*} Returns the property value.
6703 */
6704 function safeGet(object, key) {
6705 if (key === 'constructor' && typeof object[key] === 'function') {
6706 return;
6707 }
6708
6709 if (key == '__proto__') {
6710 return;
6711 }
6712
6713 return object[key];
6714 }
6715
6716 /**
6717 * Sets metadata for `func`.

Callers 2

baseMergeFunction · 0.85
baseMergeDeepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected