MCPcopy
hub / github.com/lodash/lodash / basePullAll

Function basePullAll

lodash.js:3861–3886  ·  view source on GitHub ↗

* The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {F

(array, values, iteratee, comparator)

Source from the content-addressed store, hash-verified

3859 * @returns {Array} Returns `array`.
3860 */
3861 function basePullAll(array, values, iteratee, comparator) {
3862 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
3863 index = -1,
3864 length = values.length,
3865 seen = array;
3866
3867 if (array === values) {
3868 values = copyArray(values);
3869 }
3870 if (iteratee) {
3871 seen = arrayMap(array, baseUnary(iteratee));
3872 }
3873 while (++index < length) {
3874 var fromIndex = 0,
3875 value = values[index],
3876 computed = iteratee ? iteratee(value) : value;
3877
3878 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
3879 if (seen !== array) {
3880 splice.call(seen, fromIndex, 1);
3881 }
3882 splice.call(array, fromIndex, 1);
3883 }
3884 }
3885 return array;
3886 }
3887
3888 /**
3889 * The base implementation of `_.pullAt` without support for individual

Callers 3

pullAllFunction · 0.85
pullAllByFunction · 0.85
pullAllWithFunction · 0.85

Calls 5

copyArrayFunction · 0.85
arrayMapFunction · 0.85
baseUnaryFunction · 0.85
indexOfFunction · 0.85
iterateeFunction · 0.70

Tested by

no test coverage detected