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]}}

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i changepath

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • kwijibo