math/add.js

  1. import _add from 'lodash/add'
  2. import convert from '../util/convert'
  3. /**
  4. * Replaces by the addition of the former number and the given number.
  5. * @function
  6. * @memberof math
  7. * @param {Object} object The object to modify.
  8. * @param {Array|string} path The path of the property to set.
  9. * @param {number} addend The number to add.
  10. * @return {Object} Returns the updated object.
  11. * @example add({ nested: { prop: 2 } }, 'nested.prop', 4) // => { nested: { prop: 6 } }
  12. * @see {@link https://lodash.com/docs#add|lodash.add} for more information.
  13. * @since 0.1.7
  14. */
  15. const add = convert(_add)
  16. export default add