diff --git a/CHANGELOG.md b/CHANGELOG.md index a680c99a9..dc7df9811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,18 @@ > - [Internal] > - [Polish] > - [Experimental] +> - [Deprecation] **Note**: Gaps between patch versions are faulty/broken releases. **Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice. +# 1.5.0 + +- **New Feature** + - add `UnknownType`, closes #238 (@gcanti) +- **Deprecation** + - `ThrowReporter` is now deprecated (@gcanti) + # 1.4.2 use `Compact` in `intersection` signatures as a workaround for #234 (@sledorze) diff --git a/README.md b/README.md index ab88a30e9..6794a6167 100644 --- a/README.md +++ b/README.md @@ -98,24 +98,17 @@ interface Reporter { } ``` -This package exports two default reporters - -- `PathReporter: Reporter>` -- `ThrowReporter: Reporter` +This package exports a default `PathReporter` reporter Example ```ts import { PathReporter } from 'io-ts/lib/PathReporter' -import { ThrowReporter } from 'io-ts/lib/ThrowReporter' const result = Person.decode({ name: 'Giulio' }) console.log(PathReporter.report(result)) // => ['Invalid value undefined supplied to : { name: string, age: number }/age: number'] - -ThrowReporter.report(result) -// => throws 'Invalid value undefined supplied to : { name: string, age: number }/age: number' ``` You can define your own reporter. `Errors` has the following type diff --git a/package.json b/package.json index 4dfbe7fe0..778680c34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "io-ts", - "version": "1.4.2", + "version": "1.5.0", "description": "TypeScript compatible runtime type system for IO validation", "files": [ "lib" diff --git a/src/ThrowReporter.ts b/src/ThrowReporter.ts index 81d095ed5..b33464c50 100644 --- a/src/ThrowReporter.ts +++ b/src/ThrowReporter.ts @@ -3,6 +3,7 @@ import { PathReporter } from './PathReporter' /** * @since 1.0.0 + * @deprecated */ export const ThrowReporter: Reporter = { report: validation => {