array/xor.js

  1. import update from '../object/update'
  2. import xor from 'lodash/xor'
  3. /**
  4. * Replaces by an array of unique values that is the symmetric difference of the former array and the given arrays.
  5. * @function xor
  6. * @memberof array
  7. * @param {Object} object The object to modify.
  8. * @param {Array|string} path The path of the property to set.
  9. * @param {...Array} arrays The arrays to inspect.
  10. * @return {Array} Returns the new array of filtered values.
  11. * @example xor({ nested: { prop: [1, 2] } }, 'nested.prop', [2, 3]) // => { nested: { prop: [1, 3] } }
  12. * @see {@link https://lodash.com/docs#xor|lodash.xor} for more information.
  13. * @see {@link object.update|update} for more information.
  14. * @since 0.1.6
  15. */
  16. export default update(xor)