obj-dot-props

1.1.0 • Public • Published

obj-dot-props

What does it do?

It returns a list of a given objects properties (paths), including nested properties in dot notation format.

How do I use it?

const getDotProps = require('obj-dot-props');
 
const obj = { a: 1, b: [2, 3], c: { d: 4 } };
const props = getDotProps(obj);
 
// returns ['a', 'b[0]', 'b[1]', 'c.d'];

Anything else?

This is designed to be compatible with lodash's .get and .set methods, so you can iterate through an object and get / update all of it's nested values.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i obj-dot-props

    Weekly Downloads

    5

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    4.62 kB

    Total Files

    8

    Last publish

    Collaborators

    • s-taylor