mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v4.17.5.
This commit is contained in:
21
_safeGet.js
Normal file
21
_safeGet.js
Normal file
@@ -0,0 +1,21 @@
|
||||
define([], function() {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the value at `key`, unless `key` is "__proto__".
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {*} Returns the property value.
|
||||
*/
|
||||
function safeGet(object, key) {
|
||||
return key == '__proto__'
|
||||
? undefined
|
||||
: object[key];
|
||||
}
|
||||
|
||||
return safeGet;
|
||||
});
|
||||
Reference in New Issue
Block a user