1.0.0 • Published 26 days ago

objleaves v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

objleaves

A javascript util method that return all the leaves path of an object. That can be useful when you need the leaves path to implement some custom logic on you JSON using lodash get/set methods.

Install with YARN

yarn add objleaves

Install with NPM

npm i objleaves

Example

const object = {
    isNested: true,
    people: [{
        name: 'Jane',
        lastName: 'Doe',
        dogs: [
            { name: 'Skippy'},
            { name: 'Lessie'},
        ],
        isHappy: true,
    }],
}

console.log(objectLeaves(object))

/* *** OUTPUT *** 
 * isNested
 * people[0].name
 * people[0].lastName
 * people[0].dogs[0].name
 * people[0].dogs[1].name
 * people[0].isHappy
 * *** ****** ***
 */
1.0.0

26 days ago

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago