mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Bump to v4.17.11.
This commit is contained in:
11
_safeGet.js
11
_safeGet.js
@@ -1,8 +1,5 @@
|
||||
define([], function() {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the value at `key`, unless `key` is "__proto__".
|
||||
*
|
||||
@@ -12,9 +9,11 @@ define([], function() {
|
||||
* @returns {*} Returns the property value.
|
||||
*/
|
||||
function safeGet(object, key) {
|
||||
return key == '__proto__'
|
||||
? undefined
|
||||
: object[key];
|
||||
if (key == '__proto__') {
|
||||
return;
|
||||
}
|
||||
|
||||
return object[key];
|
||||
}
|
||||
|
||||
return safeGet;
|
||||
|
||||
Reference in New Issue
Block a user