Sha256: 4617fb7d53b1982e8286e08841b94c879395c995774570e2c06d06ca3976b2c3

Contents?: true

Size: 1.19 KB

Versions: 275

Compression:

Stored size: 1.19 KB

Contents

var arrayFilter = require('./_arrayFilter'),
    baseRest = require('./_baseRest'),
    baseXor = require('./_baseXor'),
    isArrayLikeObject = require('./isArrayLikeObject'),
    last = require('./last');

/**
 * This method is like `_.xor` except that it accepts `comparator` which is
 * invoked to compare elements of `arrays`. The order of result values is
 * determined by the order they occur in the arrays. 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 filtered values.
 * @example
 *
 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
 *
 * _.xorWith(objects, others, _.isEqual);
 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
 */
var xorWith = baseRest(function(arrays) {
  var comparator = last(arrays);
  comparator = typeof comparator == 'function' ? comparator : undefined;
  return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});

module.exports = xorWith;

Version data entries

275 entries across 273 versions & 30 rubygems

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