# has-deep-property

> performs a deep hasOwnProperty check

Latest version **1.0.0** (published 2017-01-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install has-deep-property
pnpm add has-deep-property
yarn add has-deep-property
bun add has-deep-property
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-01-01 |
| First published | 2017-01-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andy Stocchetti |
| Maintainers | ajstocchetti |
| Keywords | hasOwnProperty, property |

## Links

- npm: https://www.npmjs.com/package/has-deep-property
- Repository: https://github.com/ajstocchetti/hasDeepProperty
- Homepage: https://github.com/ajstocchetti/hasDeepProperty#readme
- Issues: https://github.com/ajstocchetti/hasDeepProperty/issues
- npm.io page: https://npm.io/package/has-deep-property

## Recent versions

- 1.0.0 (latest) — 2017-01-01

## README

# hasDeepProperty
Check if object has deep/nested properties.

Checks if a nested property exists. Rather than check write out the full path for each level you want to check, now you can check the full path all at once
```javascript
// old messy way
if(obj.someProperty
    && obj.someProperty.anotherProp
    && obj.someProperty.anotherProp.moreProps
    && obj.someProperty.anotherProp.moreProps.youGetThePicture) {
    // do something
}

// new clean way
var hasDeepProperty = require('has-deep-property');
if(hasDeepProperty(obj, ['someProperty', 'anotherProp', 'moreProps', 'youGetThePicture'])) {
    // do something
}
```

## Installation

```
$ npm install --save hasDeepProperty
```

## API
hasDeepProperty takes two parameters:
* the object to check
* an array of properties to check

and returns `true` or `false` depending on whether the full path of properties exists
```
var hasDeepProperty = require('has-deep-property');

var obj = {
    foo: {
        bar: {
            baz: 'exists'
        }
    }
}

hasDeepProperty(obj, ['foo']); // true
hasDeepProperty(obj, ['foo', 'bar', 'baz']); // true
hasDeepProperty(obj, ['foo', 'buzz']); // false
```

---
_Source: https://npm.io/package/has-deep-property · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
