Sha256: bba30e5ff749bb138fb61863f96df81b4f086fa982e49ff30d395568d7a0c409

Contents?: true

Size: 1.42 KB

Versions: 279

Compression:

Stored size: 1.42 KB

Contents

var arrayMap = require('./_arrayMap'),
    baseIndexOf = require('./_baseIndexOf'),
    baseIndexOfWith = require('./_baseIndexOfWith'),
    baseUnary = require('./_baseUnary'),
    copyArray = require('./_copyArray');

/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * 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 {Function} [comparator] The comparator invoked per element.
 * @returns {Array} Returns `array`.
 */
function basePullAll(array, values, iteratee, comparator) {
  var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
      index = -1,
      length = values.length,
      seen = array;

  if (array === values) {
    values = copyArray(values);
  }
  if (iteratee) {
    seen = arrayMap(array, baseUnary(iteratee));
  }
  while (++index < length) {
    var fromIndex = 0,
        value = values[index],
        computed = iteratee ? iteratee(value) : value;

    while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
      if (seen !== array) {
        splice.call(seen, fromIndex, 1);
      }
      splice.call(array, fromIndex, 1);
    }
  }
  return array;
}

module.exports = basePullAll;

Version data entries

279 entries across 275 versions & 31 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.59 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.58 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.57 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.56 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.55 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.54 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.53 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.52 node_modules/lodash/_basePullAll.js
trusty-cms-6.3.1 node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.51 node_modules/lodash/_basePullAll.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_basePullAll.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
immosquare-cleaner-0.1.50 node_modules/lodash/_basePullAll.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/_basePullAll.js