object/unset.js

  1. import fpUnset from 'lodash/fp/unset'
  2. import { lodashFpConvertOptions } from '../consts'
  3. /**
  4. * Removes the property at <code>path</code> of <code>object</code>.
  5. * This is the <code>lodash/fp</code> <code>unset</code>, with no arguments rearranging and no currying.
  6. * @function unset
  7. * @memberof object
  8. * @param {Object} object The object to modify.
  9. * @param {Array|string} path The path of the property to unset.
  10. * @return {Object} Returns the updated object.
  11. * @example unset({ nested: { prop: 'value' } }, 'nested.prop') // => { nested: {} }
  12. * @see {@link https://lodash.com/docs#unset|lodash.unset} for more information.
  13. * @since 0.1.5
  14. */
  15. export default fpUnset.convert(lodashFpConvertOptions)