UNPKG

483 BJavaScriptView Raw
1import nativeCreate from './_nativeCreate';
2
3/** Used to stand-in for `undefined` hash values. */
4var HASH_UNDEFINED = '__lodash_hash_undefined__';
5
6/**
7 * Sets the hash `key` to `value`.
8 *
9 * @private
10 * @param {Object} hash The hash to modify.
11 * @param {string} key The key of the value to set.
12 * @param {*} value The value to set.
13 */
14function hashSet(hash, key, value) {
15 hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
16}
17
18export default hashSet;