object/omit.js

  1. import { omit as _omit } from 'lodash'
  2. import { apply } from 'immutadot/core'
  3. /**
  4. * Replaces by an object omitting specified properties.
  5. * @function
  6. * @memberof object
  7. * @param {Object} object The object to modify.
  8. * @param {Array|string} path The path of the property to set.
  9. * @param {...(string|string[])} [paths] The property paths to omit.
  10. * @return {Object} Returns the updated object.
  11. * @example omit({ nested: { a: 1, b: 2, c: 3 } }, 'nested', 'b') // => { nested: { a:1, c: 3 } }
  12. * @see {@link https://lodash.com/docs#omit|lodash.omit} for more information.
  13. * @since 1.0.0
  14. */
  15. const omit = apply(_omit, { arity: 1 })
  16. export { omit }