diff --git a/README.md b/README.md index 77e8145..153f683 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ Decodes a JSON string into a TypeScript `string`. ### stringUnion ```ts -function stringUnion]>( +function stringUnion]>( variants: T ): Decoder; ``` @@ -497,7 +497,7 @@ See also the [renaming union field example](examples/renaming-union-field.test.t ### tuple ```ts -function tuple>( +function tuple>( mapping: readonly [...{ [P in keyof T]: Decoder }] ): Decoder<[...T]>; ``` diff --git a/index.ts b/index.ts index b85a460..461e50e 100644 --- a/index.ts +++ b/index.ts @@ -37,7 +37,7 @@ export function string(value: unknown): string { return value; } -export function stringUnion]>( +export function stringUnion]>( variants: readonly [...T] ): Decoder { return function stringUnionDecoder(value: unknown): T[number] { @@ -234,7 +234,7 @@ export function fieldsUnion>>( >; } -export function tuple>( +export function tuple>( mapping: readonly [...{ [P in keyof T]: Decoder }] ): Decoder<[...T]> { return function tupleDecoder(value: unknown): [...T] {