math/multiply.js

  1. import _multiply from 'lodash/multiply'
  2. import { convert } from 'util/convert'
  3. /**
  4. * Replaces by the multiplication 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} multiplicand The second number in the multiplication.
  10. * @return {Object} Returns the updated object.
  11. * @example multiply({ nested: { prop: 333 } }, 'nested.prop', 2) // => { nested: { prop: 666 } }
  12. * @see {@link https://lodash.com/docs#multiply|lodash.multiply} for more information.
  13. * @since 0.3.0
  14. */
  15. const multiply = convert(_multiply)
  16. export { multiply, multiply as default }