From 464885a5397785a701c1880ad9cd0fbc3afd1a7b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 15 May 2016 20:57:10 -0700 Subject: [PATCH] Add `getValue` helper. --- lodash.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index e0dcbd9b9..9315671a8 100644 --- a/lodash.js +++ b/lodash.js @@ -1006,6 +1006,18 @@ return '\\' + stringEscapes[chr]; } + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object[key]; + } + /** * Gets the index at which the first occurrence of `NaN` is found in `array`. * @@ -5393,7 +5405,7 @@ * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { - var value = object[key]; + var value = getValue(object, key); return (isMaskable(value) ? baseIsNative : isNative)(value) ? value : undefined; }