mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
22 lines
413 B
JavaScript
22 lines
413 B
JavaScript
define(['../lang/isObject'], function(isObject) {
|
|
|
|
/**
|
|
* Adds `value` to the cache.
|
|
*
|
|
* @private
|
|
* @name push
|
|
* @memberOf SetCache
|
|
* @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;
|
|
}
|
|
}
|
|
|
|
return cachePush;
|
|
});
|