# noes

> Javascript conjunction library

Latest version **1.1.1** (published 2018-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install noes
pnpm add noes
yarn add noes
bun add noes
```

## 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.1 |
| Published | 2018-10-03 |
| First published | 2016-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 42.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sendy Halim |
| Maintainers | sendyhalim |
| Keywords | conjunction, validator |

## Links

- npm: https://www.npmjs.com/package/noes
- Repository: https://github.com/sendyhalim/noes
- Homepage: https://github.com/sendyhalim/noes#readme
- Issues: https://github.com/sendyhalim/noes/issues
- npm.io page: https://npm.io/package/noes

## Dependencies (1)

- [ramda](https://npm.io/package/ramda.md) ^0.25.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-10-03
- 1.0.1 — 2017-01-05
- 1.0.0 — 2017-01-04
- 0.1.2 — 2017-01-04
- 0.1.1 — 2017-01-04
- 0.1.0 — 2017-01-04
- 0.0.6 — 2016-05-09
- 0.0.5 — 2016-05-09
- 0.0.4 — 2016-05-09
- 0.0.3 — 2016-05-09
- 0.0.2 — 2016-05-04
- 0.0.1 — 2016-05-04

## README

# Noes
`Noes` is a javascript library that checks if its conjunction is satisfied.

[![Build Status](https://travis-ci.org/sendyhalim/noes.svg)](https://travis-ci.org/sendyhalim/noes)
[![npm version](https://badge.fury.io/js/noes.svg)](https://badge.fury.io/js/noes)

## Installation
```
npm install noes --save
```

## Quick usage

#### Or
```js
import noes from 'noes';

const or = new noes.Or({
  tywin: 'lannister',
  day: 'light',
  game: 'of thrones'
});

or.satisfied({day: 'light'}); // true
or.satisfied({game: 'of thrones'}); // true
or.satisfied({}); // false
or.satisfied({
  tywin: 'lanniser',
  day: 'liht',
  game: 'of-thrones'
}); // false
```

#### And
```js
import noes from 'noes';

const and = new conjunction.And({
  tywin: 'lannister',
  day: 'light',
  game: 'of thrones'
});

and.satisfied({
  tywin: 'lannister',
  day: 'light',
  game: 'of thrones'
}); // true
and.satisfied({
  tywin: 'lannister',
  day: 'light',
  game: 'of-thrones'
}) // false
and.satisfied({}) // false
```

#### Array value
When the given mapping value is an array of predicate object,
then it will be satisfied if the given input satisfies the predicate objects based on its parent's type. Example:

```js
const and = new conjunction.And({
  name: [
    {$notEqual: 'hi'},
    {'!==': 'there'}
  ],
  iron: 'man'
});

and.satisfied({name: 'hehe', iron: 'man'}) // true

// Will return false because name must not be equal to 'hi' and 'there'
and.satisfied({name: 'there', iron: 'man'})


const or = new conjunction.Or({
  name: [
    {$equal: 'hi'},
    {'===': 'there'}
  ],
  iron: 'man'
});

// Will return true because 'iron' property is satisfied
or.satisfied({name: 'hehe', iron: 'man'})

// Will return true because name must be equal to 'hi' or 'there'
or.satisfied({name: 'there', iron: 'man'})
```


## Nested example
`Noes` supports nested examples (you can nest as deep as you want)

```js
const or = new conjunction.Or({
  name: new conjunction.Or({
    ye: 'saboteur',
    lannister: 'approves'
  })
});

// Or with an object
const or = new conjunction.Or({
  name: {
    type: 'or',
    mappings: {
      ye: 'saboteur',
      lannister: 'approves'
    }
  }
});
```

## License
MIT

![Hug](https://media.giphy.com/media/l3V0oeWJZQru5gGTS/giphy.gif)

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