@jcoreio/mutate
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@jcoreio/mutate

Build Status Coverage Status semantic-release Commitizen friendly

a few immutable.js-like mutation functions for plain objects

Beware of using Ramda.js! It always returns a new object, even if nothing changed!

Usage

pnpm install --save @jcoreio/mutate

API

setIn(obj: any, path: Iterable<any>, newValue: any): any

const { setIn } = require('@jcoreio/mutate')

Works just like setIn from Immutable.js but operates on nested JS Objects and Arrays.

updateIn(obj: any, path: Iterable<any>, [notSetValue: any], updater: (value: any) => any): any

const { updateIn } = require('@jcoreio/mutate')

Works just like updateIn from Immutable.js but operates on nested JS Objects and Arrays.

Dependents (0)

Package Sidebar

Install

npm i @jcoreio/mutate

Weekly Downloads

358

Version

2.0.0

License

MIT

Unpacked Size

9.19 kB

Total Files

12

Last publish

Collaborators

  • gravitate1838
  • avramdodson
  • forrest-keller
  • jrmclaurin
  • jedwards1211
  • eladendorf