Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-09-17 17:52:09 -07:00
parent 1d77dfa4b7
commit 54e7baecc3
675 changed files with 11257 additions and 8085 deletions

View File

@@ -1,7 +1,10 @@
import isObject from '../lang/isObject';
import isKeyable from './isKeyable';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the cache.
* Adds `value` to the set cache.
*
* @private
* @name push
@@ -9,11 +12,15 @@ import isObject from '../lang/isObject';
* @param {*} value The value to cache.
*/
function cachePush(value) {
var data = this.data;
if (typeof value == 'string' || isObject(value)) {
data.set.add(value);
} else {
data.hash[value] = true;
var map = this.__data__;
if (isKeyable(value)) {
var data = map.__data__,
hash = typeof value == 'string' ? data.string : data.hash;
hash[value] = HASH_UNDEFINED;
}
else {
map.set(value, HASH_UNDEFINED);
}
}