decoders 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## v2.0.3 (not released yet)
2
+
3
+ - Fix bundling issue where TypeScript types would not get picked up correctly in old
4
+ TypeScript versions. Thanks, @robinchow!
5
+
6
+ - ![](./docs/assets/tiny-ts-logo.png) Fix TypeScript types for `Result` type to allow
7
+ implicit-undefineds.
8
+
9
+ ## v2.0.2
10
+
11
+ - ![](./docs/assets/tiny-ts-logo.png) Fix TypeScript types for `formatShort` and
12
+ `formatInline` helper functions
13
+
1
14
  ## v2.0.1
2
15
 
3
16
  - ![](./docs/assets/tiny-ts-logo.png) **TypeScript-only:** Fix definition of JSONObject
package/format.d.ts CHANGED
@@ -2,5 +2,5 @@ import { Annotation } from './annotate';
2
2
 
3
3
  export type Formatter = (err: Annotation) => string | Error;
4
4
 
5
- export const formatInline: Formatter;
6
- export const formatShort: Formatter;
5
+ export function formatInline(err: Annotation): string;
6
+ export function formatShort(err: Annotation): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decoders",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Elegant and battle-tested validation library for type-safe input data (for TypeScript and Flow)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "main": "./index.js",
16
16
  "module": "./index.mjs",
17
+ "types": "./index.d.ts",
17
18
  "keywords": [
18
19
  "decoders",
19
20
  "Decoder",
package/result.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export interface Ok<T> {
2
2
  ok: true;
3
3
  value: T;
4
- error: undefined;
4
+ error?: never;
5
5
  }
6
6
 
7
7
  export interface Err<E> {
8
8
  ok: false;
9
- value: undefined;
10
9
  error: E;
10
+ value?: never;
11
11
  }
12
12
 
13
13
  export type Result<T, E> = Ok<T> | Err<E>;