Sha256: 671b23dd36dbd57a7c18d9efef2627def32173a0446cc689bc8726115a65bfbf

Contents?: true

Size: 1.07 KB

Versions: 273

Compression:

Stored size: 1.07 KB

Contents

var baseDifference = require('./_baseDifference'),
    baseFlatten = require('./_baseFlatten'),
    baseUniq = require('./_baseUniq');

/**
 * The base implementation of methods like `_.xor`, without support for
 * iteratee shorthands, that accepts an array of arrays to inspect.
 *
 * @private
 * @param {Array} arrays The arrays to inspect.
 * @param {Function} [iteratee] The iteratee invoked per element.
 * @param {Function} [comparator] The comparator invoked per element.
 * @returns {Array} Returns the new array of values.
 */
function baseXor(arrays, iteratee, comparator) {
  var length = arrays.length;
  if (length < 2) {
    return length ? baseUniq(arrays[0]) : [];
  }
  var index = -1,
      result = Array(length);

  while (++index < length) {
    var array = arrays[index],
        othIndex = -1;

    while (++othIndex < length) {
      if (othIndex != index) {
        result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
      }
    }
  }
  return baseUniq(baseFlatten(result, 1), iteratee, comparator);
}

module.exports = baseXor;

Version data entries

273 entries across 271 versions & 29 rubygems

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