Socket
Book a DemoInstallSign in
Socket

@jcoreio/mutate

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcoreio/mutate

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

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
0
Maintainers
5
Weekly downloads
 
Created
Source

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

Keywords

immutable

FAQs

Package last updated on 25 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts