# @whi/skeptic

> A quality control validation library built on top of @whi/serious-error-types

Latest version **0.1.5** (published 2021-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install @whi/skeptic
pnpm add @whi/skeptic
yarn add @whi/skeptic
bun add @whi/skeptic
```

## 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.5 |
| Published | 2021-06-19 |
| First published | 2020-05-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthew Brisebois |
| Maintainers | webheroesinc, brisebom |

## Links

- npm: https://www.npmjs.com/package/@whi/skeptic
- Repository: https://github.com/mjbrisebois/skeptic
- Homepage: https://github.com/mjbrisebois/skeptic#readme
- Issues: https://github.com/mjbrisebois/skeptic/issues
- npm.io page: https://npm.io/package/@whi/skeptic

## Dependencies (1)

- [@whi/serious-error-types](https://npm.io/package/@whi/serious-error-types.md) ^0.1.10

## Recent versions

- 0.1.5 (latest) — 2021-06-19
- 0.1.4 — 2021-06-19
- 0.1.3 — 2020-06-08
- 0.1.2 — 2020-05-29
- 0.1.1 — 2020-05-27
- 0.1.0 — 2020-05-15

## README

[![](https://img.shields.io/npm/v/@whi/skeptic/latest?style=flat-square)](http://npmjs.com/package/@whi/skeptic)

# Skeptic
A quality control validation library built on top of `@whi/serious-error-types`.  It enables
developers to clearly state input/output assumptions in their code.

[![](https://img.shields.io/github/issues-raw/mjbrisebois/skeptic?style=flat-square)](https://github.com/mjbrisebois/skeptic/issues)
[![](https://img.shields.io/github/issues-closed-raw/mjbrisebois/skeptic?style=flat-square)](https://github.com/mjbrisebois/skeptic/issues?q=is%3Aissue+is%3Aclosed)
[![](https://img.shields.io/github/issues-pr-raw/mjbrisebois/skeptic?style=flat-square)](https://github.com/mjbrisebois/skeptic/pulls)

## Overview
These validation methods cover more complex scenarios and throw specific error types where `assert`
statements would only throw `AssertionError`.

### Usage

```javascript
const { SeriousErrors,
        FunctionIO,
        DatabaseIO } = require('@whi/skeptic');

function user ( name, age ) {
    FunctionIO.validateArguments(arguments, [
        FunctionIO.requiredArgumentType("string", "User's Name"),
        FunctionIO.optionalArgumentType("number", "User's Age"),
    ]);
}

user();
// throws MissingArgumentError

user( 22 );
// throws InvalidArgumentError

user( "Dave" );
// will not throw

user( "Dave", null );
// throws InvalidArgumentError

user( "Dave", 22 );
// will not throw
```

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