2.0.0 • Published 9 months ago

@jcoreio/mutate v2.0.0

Weekly downloads
28
License
MIT
Repository
github
Last release
9 months ago

@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.

2.0.0

9 months ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago