smart-table-json-pointer
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

smart-table-json-pointer

CircleCI

  1. Access nested property within an object
  2. Replace nested value with a new value

For nodejs and browsers.

Installation

npm

npm install --save smart-table-json-pointer

yarn

``yarn add smart-table-json-pointer

Usage

import jsonPointer from 'smart-table-json-pointer'

const pointer = jsonPointer('foo.bar.woot');

pointer.get({foo:'value'});
// > undefined

pointer.get({foo:{bar:{woot:'value'}}});
// > 'value'

const target = {foo:{bar:{woot:{blah:'nut'}}}};
pointer.set(target,{ni:'bup'});

console.log(target);
// >  {foo:{bar:{woot:{ni:'bup'}}}};

/smart-table-json-pointer/

    Package Sidebar

    Install

    npm i smart-table-json-pointer

    Weekly Downloads

    138

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    11.9 kB

    Total Files

    11

    Last publish

    Collaborators

    • lorenzofox3