mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
# add dist
This commit is contained in:
42
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/intersectionWith.js
generated
vendored
Normal file
42
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/intersectionWith.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
var arrayMap = require('./_arrayMap'),
|
||||
baseIntersection = require('./_baseIntersection'),
|
||||
castArrayLikeObject = require('./_castArrayLikeObject'),
|
||||
last = require('./last'),
|
||||
rest = require('./rest');
|
||||
|
||||
/**
|
||||
* This method is like `_.intersection` except that it accepts `comparator`
|
||||
* which is invoked to compare elements of `arrays`. Result values are chosen
|
||||
* from the first array. The comparator is invoked with two arguments:
|
||||
* (arrVal, othVal).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of intersecting values.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
||||
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
||||
*
|
||||
* _.intersectionWith(objects, others, _.isEqual);
|
||||
* // => [{ 'x': 1, 'y': 2 }]
|
||||
*/
|
||||
var intersectionWith = rest(function(arrays) {
|
||||
var comparator = last(arrays),
|
||||
mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
|
||||
if (comparator === last(mapped)) {
|
||||
comparator = undefined;
|
||||
} else {
|
||||
mapped.pop();
|
||||
}
|
||||
return (mapped.length && mapped[0] === arrays[0])
|
||||
? baseIntersection(mapped, undefined, comparator)
|
||||
: [];
|
||||
});
|
||||
|
||||
module.exports = intersectionWith;
|
Reference in New Issue
Block a user