Added the underscore node_module.
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
This commit is contained in:
21
node_modules/underscore/cjs/intersection.js
generated
vendored
Normal file
21
node_modules/underscore/cjs/intersection.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
var _getLength = require('./_getLength.js');
|
||||
var contains = require('./contains.js');
|
||||
|
||||
// Produce an array that contains every item shared between all the
|
||||
// passed-in arrays.
|
||||
function intersection(array) {
|
||||
var result = [];
|
||||
var argsLength = arguments.length;
|
||||
for (var i = 0, length = _getLength(array); i < length; i++) {
|
||||
var item = array[i];
|
||||
if (contains(result, item)) continue;
|
||||
var j;
|
||||
for (j = 1; j < argsLength; j++) {
|
||||
if (!contains(arguments[j], item)) break;
|
||||
}
|
||||
if (j === argsLength) result.push(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = intersection;
|
Reference in New Issue
Block a user