1 var SetCache = require('./SetCache'),
2 getNative = require('./getNative');
4 /** Native method references. */
5 var Set = getNative(global, 'Set');
7 /* Native method references for those with the same name as other `lodash` methods. */
8 var nativeCreate = getNative(Object, 'create');
11 * Creates a `Set` cache object to optimize linear searches of large arrays.
14 * @param {Array} [values] The values to cache.
15 * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
17 function createCache(values) {
18 return (nativeCreate && Set) ? new SetCache(values) : null;
21 module.exports = createCache;