1 var SetCache = require('./SetCache'),
2 constant = require('../utility/constant'),
3 isNative = require('../lang/isNative');
5 /** Native method references. */
6 var Set = isNative(Set = global.Set) && Set;
8 /* Native method references for those with the same name as other `lodash` methods. */
9 var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
12 * Creates a `Set` cache object to optimize linear searches of large arrays.
15 * @param {Array} [values] The values to cache.
16 * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
18 var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
19 return new SetCache(values);
22 module.exports = createCache;