array/concat.js

  1. import _concat from 'lodash/concat'
  2. import convert from '../util/convert'
  3. /**
  4. * Replaces an array concatenating the former array with additional arrays and/or values.
  5. * @function
  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 concatenate.
  10. * @return {Object} Returns the updated object.
  11. * @example concat({ nested: { prop: [1, 2] } }, 'nested.prop', [3, 4]) // => { nested: { prop: [1, 2, 3, 4] } }
  12. * @see {@link https://lodash.com/docs#concat|lodash.concat} for more information.
  13. * @since 0.2.0
  14. */
  15. const concat = convert(_concat)
  16. export default concat