deephas

    1.0.7 • Public • Published

    Build Status

    deepHas

    test for existence of nested object key and optionally return that key

    Installation

    npm install deephas

    or just drop deepHas.js into your project.

    Usage

    dh = require("deepHas");\n var obj = {"some": {"nested": {"property":""your value here"}}};

    dh.has(obj, 'some.nested.property')

    Returns true or false if 'some.nested.property' exists or not.

    dh.get(obj, 'some.nested.property')

    Returns the value or undefined if it does not exist.

    dh.set(obj, 'some.nested.newproperty', "your value here")

    Adds a new property or object.

    Install

    npm i deephas

    DownloadsWeekly Downloads

    16

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    12.1 kB

    Total Files

    16

    Last publish

    Collaborators

    • paulatstepup