mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
27
.internal/hashGet.js
Normal file
27
.internal/hashGet.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import nativeCreate from './.internal/nativeCreate.js';
|
||||
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
const HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Gets the hash value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @name get
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function hashGet(key) {
|
||||
const data = this.__data__;
|
||||
if (nativeCreate) {
|
||||
const result = data[key];
|
||||
return result === HASH_UNDEFINED ? undefined : result;
|
||||
}
|
||||
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
||||
}
|
||||
|
||||
export default hashGet;
|
||||
Reference in New Issue
Block a user