0.0.1 • Published 2 years ago

zget v0.0.1

Weekly downloads
4
License
MIT
Repository
-
Last release
2 years ago

zget = safe get

a tiny and safety function to accessing deeply nested JS object property.

This is one of must-have function that I need to use in every js projects, instead of installing lodash, ramda or any other utility library

install

    npm i --save zget
    // or
    yarn add zget

usage

    import zget from "zget"

    zget(object, path)

    var object = { 'a': [{ 'b': { 'c': 3 } }] };

    zget(object, 'a.0.b.c');
    // => 3

    zget(object, ['a', '0', 'b', 'c']);
    // => 3

    zget(object, 'a.c');
    // => 'undefined'
0.0.1

2 years ago

2.0.0

2 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago