# io-ts-excess

> Decoder for io-ts to check, that object is exactly the same

Latest version **1.0.1** (published 2019-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install io-ts-excess
pnpm add io-ts-excess
yarn add io-ts-excess
bun add io-ts-excess
```

## 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-07-19 |
| First published | 2019-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | goooseman |
| Maintainers | trucknet |
| Keywords | io-ts, exact, excess |

## Links

- npm: https://www.npmjs.com/package/io-ts-excess
- Repository: https://github.com/goooseman/io-ts-excess
- Issues: https://github.com/goooseman/io-ts-excess/issues
- npm.io page: https://npm.io/package/io-ts-excess

## Dependencies (1)

- [io-ts](https://npm.io/package/io-ts.md) ^2.0.0

## Recent versions

- 1.0.1 (latest) — 2019-07-19
- 1.0.0 — 2019-07-19

## README

# io-ts-excess

A type for [io-ts](https://github.com/gcanti/io-ts) library, which will fail on any additional properties.

Thanks to [@gcanti](https://github.com/gcanti) for the [original code](https://github.com/gcanti/io-ts/issues/322#issuecomment-513170377).

> Warning! Does not work from inside intersection!

## Usage

```typescript
import * as t from "io-ts";
import excess from "io-ts-excess";

const C = excess(
  t.type({
    a: t.string,
  }),
);

import { PathReporter } from "io-ts/lib/PathReporter";

console.log(PathReporter.report(C.decode({ a: "a", b: 1 })));
// [ 'Invalid value {"a":"a","b":1} supplied to : { a: string }, excess properties: ["b"]' ]
```

## TODO

- [ ] Make it to work inside intersection. The following code does not work for now:
```typescript
const I = t.intersection([C, t.type({ b: t.number })])

console.log(PathReporter.report(I.decode({ a: 'a', b: 1 })))
// [ 'Invalid value {"a":"a","b":1} supplied to : { a: string }, excess properties: ["b"]' ]
```

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