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
disco_app-0.18.2 test/dummy/node_modules/lodash/_baseXor.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/_baseXor.js
trusty-cms-5.0.7 node_modules/lodash/_baseXor.js
appmap-0.72.2 ./node_modules/lodash/_baseXor.js
trusty-cms-5.0.6 node_modules/lodash/_baseXor.js
appmap-0.72.1 ./node_modules/lodash/_baseXor.js
appmap-0.72.0 ./node_modules/lodash/_baseXor.js
trusty-cms-5.0.5 node_modules/lodash/_baseXor.js
trusty-cms-5.0.4 node_modules/lodash/_baseXor.js
appmap-0.71.0 ./node_modules/lodash/_baseXor.js
disco_app-0.16.1 test/dummy/node_modules/lodash/_baseXor.js
appmap-0.70.2 ./node_modules/lodash/_baseXor.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/_baseXor.js
appmap-0.70.1 ./node_modules/lodash/_baseXor.js
appmap-0.70.0 ./node_modules/lodash/_baseXor.js
appmap-0.69.0 ./node_modules/lodash/_baseXor.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/_baseXor.js
appmap-0.68.2 ./node_modules/lodash/_baseXor.js
appmap-0.68.1 ./node_modules/lodash/_baseXor.js
disco_app-0.15.2 test/dummy/node_modules/lodash/_baseXor.js