changepath

1.0.0 • Public • Published

changepath.js

changePath is a simple function for changing the value at the end of a path through a javascript data structure.

It does not mututate the source object It respects the source object's prototype chain

Usage:

import {changePath} from 'changepathjs'

const x = {a: { b: [99]}}

const y = changePath(['a','b',0], 66, x)

// {a: { b: [66]}}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i changepath

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • kwijibo