# introspect-constrain

> A small library to modelize constraints

Latest version **0.1.1** (published 2014-11-09) · GPL license · 0 weekly downloads

## Install

```sh
npm install introspect-constrain
pnpm add introspect-constrain
yarn add introspect-constrain
bun add introspect-constrain
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-11-09 |
| First published | 2014-11-09 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | subtenante@gmail.com |
| Maintainers | subtenante |
| Keywords | javascript, constraint, es6 |

## Links

- npm: https://www.npmjs.com/package/introspect-constrain
- Repository: https://github.com/subtenante/introspect-constrain
- Issues: https://github.com/subtenante/introspect-constrain/issues
- npm.io page: https://npm.io/package/introspect-constrain

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) 2.x.x

## Recent versions

- 0.1.1 (latest) — 2014-11-09
- 0.1.0 — 2014-11-09

## README

# introspect-constrain

Provides rudimentary logic for constraint checking.

<!-- toc -->

* [Install](#install)
* [API](#api)
  * [`contraint`](#contraint)
  * [`constraints`](#constraints)
  * [`failure`](#failure)
  * [`report`](#report)

<!-- toc stop -->

## Install

    npm install introspect-constrain

## API

### `contraint`

This function returns a `Constraint` object.

A constraint is basically a wrapper around a predicate function,
allowing to check values with this predicate function (in a given context
passed by a `Report` object).

### `constraints`

This function returns a `Constraints` object which is basically a list
of constraints, which can all be checked on the same value/report with the
`checkAll` function.

### `failure`

This function returns a `Failure` object. A failure is created each time
a constraint predicate returns a falsey value. The failure is always added
to the report passed to the constraint `check` function.

### `report`

This function returns a `Report` object, which is basically a list of failures.
Reports can be combined to import all the failures of several reports into
a single one.

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