Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / createCache.js
1 var SetCache = require('./SetCache'),
2     getNative = require('./getNative');
3
4 /** Native method references. */
5 var Set = getNative(global, 'Set');
6
7 /* Native method references for those with the same name as other `lodash` methods. */
8 var nativeCreate = getNative(Object, 'create');
9
10 /**
11  * Creates a `Set` cache object to optimize linear searches of large arrays.
12  *
13  * @private
14  * @param {Array} [values] The values to cache.
15  * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
16  */
17 function createCache(values) {
18   return (nativeCreate && Set) ? new SetCache(values) : null;
19 }
20
21 module.exports = createCache;