mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
55
react-app/node_modules/lodash/internal/baseDifference.js
generated
vendored
Normal file
55
react-app/node_modules/lodash/internal/baseDifference.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
var baseIndexOf = require('./baseIndexOf'),
|
||||
cacheIndexOf = require('./cacheIndexOf'),
|
||||
createCache = require('./createCache');
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.difference` which accepts a single array
|
||||
* of values to exclude.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} values The values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
*/
|
||||
function baseDifference(array, values) {
|
||||
var length = array ? array.length : 0,
|
||||
result = [];
|
||||
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
var index = -1,
|
||||
indexOf = baseIndexOf,
|
||||
isCommon = true,
|
||||
cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
|
||||
valuesLength = values.length;
|
||||
|
||||
if (cache) {
|
||||
indexOf = cacheIndexOf;
|
||||
isCommon = false;
|
||||
values = cache;
|
||||
}
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
|
||||
if (isCommon && value === value) {
|
||||
var valuesIndex = valuesLength;
|
||||
while (valuesIndex--) {
|
||||
if (values[valuesIndex] === value) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
result.push(value);
|
||||
}
|
||||
else if (indexOf(values, value, 0) < 0) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseDifference;
|
Reference in New Issue
Block a user