# @lynchbox/assert

> Javascript library which contains assertions and guard methods for input validation.

Latest version **0.5.0** (published 2020-12-20) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install @lynchbox/assert
pnpm add @lynchbox/assert
yarn add @lynchbox/assert
bun add @lynchbox/assert
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2020-12-20 |
| First published | 2020-12-15 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lynchbox |
| Maintainers | lynchbox |
| Keywords | guard-methods, assertions, validation |

## Links

- npm: https://www.npmjs.com/package/@lynchbox/assert
- Repository: https://github.com/seanlynch7194/assert
- Homepage: https://github.com/seanlynch7194/assert#readme
- Issues: https://github.com/seanlynch7194/assert/issues
- npm.io page: https://npm.io/package/@lynchbox/assert

## 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

- 0.5.0 (latest) — 2020-12-20
- 0.4.0 — 2020-12-20
- 0.3.0 — 2020-12-16
- 0.2.0 — 2020-12-16
- 0.1.0 — 2020-12-15

## README

# Assert

A simple Javascript library which contains assertions and guard methods for input validation, heavily inspired by [beberlei/assert](https://github.com/beberlei/assert) for PHP.

## Installation

```bash
npm install @lynchbox/assert;
```

## List of assertions

```node
import assert from @lynchbox/assert;

assert(value: number).between(lowerlimit: number, upperLimit: number);
assert(value: string).contains('surely');
assert(value: string).eq('same');
assert(value: number).moreThanOrEqualTo(limit: number);
assert(value: number).lessThanOrEqualTo(limit: number);
assert(value: any).isIn(source: Array<any>);
assert(value: string).endsWith(needle: string);
assert(value: string).startsWith(needle: string);
assert(value: Array<any>).uniqueValues();
assert(value: number).moreThan(limit: number);
assert(value: number).lessThan(limit: number);

```

## Running Tests
Tests are written using Jest.

```bash
npm run test
```

### Code Coverage

```bash
npm run coverage
```

## Compile Typescript

```bash
npm run build
```

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