# chai-within

> A chai plugin for asserting that all properties within a small object exist in a large one

Latest version **1.0.1** (published 2019-03-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install chai-within
pnpm add chai-within
yarn add chai-within
bun add chai-within
```

## 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.1 |
| Published | 2019-03-13 |
| First published | 2018-08-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | joepuzzo |
| Maintainers | joepuzzo |
| Keywords | chai, within, object |

## Links

- npm: https://www.npmjs.com/package/chai-within
- npm.io page: https://npm.io/package/chai-within

## Dependencies (1)

- [chai](https://npm.io/package/chai.md) ^4.1.2

## Recent versions

- 1.0.1 (latest) — 2019-03-13
- 1.0.0 — 2018-08-03

## README

# chai-within

## Installation

```
npm install --save objectwithin
```

## Usage

The chai-within plugin adds the "within" method to the chai assertion lib. This assertion will deeply
compare two objects, making sure EVERY field that is in the smaller object exists in the larger one.

```js
const largeObj = {
  a: 1,
  b: 2,
  c: {
    d: 3,
    e: {
      f: 4,
      g: 6
    },
    h: 5
  },
  e: 7,
  d: 3,
  j: [
    1,
    2,
    3,
    {
      a: 7,
      b: 8
    },
    4
  ]
}

const smallObj = {
  a: 1,
  c: {
    e: {
      f: 4
    },
    h: 5
  },
  e: 7,
  j: [
    1,
    2,
    3,
    {
      a: 7
    }
  ]
}

expect( small ).to.be.within( large );
```

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