# deep-check

> check for the existence of deeply nested objects

Latest version **1.1.0** (published 2016-12-19) · 0 weekly downloads

## Install

```sh
npm install deep-check
pnpm add deep-check
yarn add deep-check
bun add deep-check
```

## 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.1.0 |
| Published | 2016-12-19 |
| First published | 2016-12-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | binocarlos |

## Links

- npm: https://www.npmjs.com/package/deep-check
- npm.io page: https://npm.io/package/deep-check

## Dependencies (1)

- [object-path](https://npm.io/package/object-path.md) ^0.11.3

## Recent versions

- 1.1.0 (latest) — 2016-12-19
- 1.0.0 — 2016-12-19

## README

# deep-check

Check that properties of a deeply-nested object exist.

## install

```bash
$ npm install deep-check
```

## usage

The schema used to check if values are present can be itself a deeply nested object:

```javascript
var deepCheck = require('deep-check')
var data = {
  fruit:{
    citrus:{
      lemons:10,
      oranges:12
    }
  },
  orders:{
    settings:{
      id:12
    }
  }
}

var schema = {
  fruit:{
    citrus:{
      lemons:true,
      weight:true
    }
  },
  orders:{
    settings:true,
    history:true
  }
}

var missing = deepCheck(data, schema)

console.log(missing)

// ['fruit.citrus.weight', 'orders.history']
```

Or you can use an array with dot-notation:

```javascript
var schema = [
  'fruit.citrus.lemons',
  'fruit.apples',
  'orders.settings',
  'orders.history'
]

var missing = deepCheck(data, schema)

console.log(missing)

// ['fruit.apples', 'orders.history']
```

## license

MIT

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