🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

deephas

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deephas

get, set or test for a value in a javascript object

latest
Source
npmnpm
Version
1.0.8
Version published
Weekly downloads
36
-7.69%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

nested

FAQs

Package last updated on 28 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts