Files
lodash/_getNative.js
John-David Dalton bc4262f901 Remove core-js guard.
2017-01-09 18:07:23 -08:00

17 lines
450 B
JavaScript

import isNative from './isNative.js';
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
const value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
export default getNative;