Skip to content

Commit

Permalink
🩹 Fix Output type
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljanocko committed May 8, 2021
1 parent 76f68f0 commit 54ca869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Decoder<D> {
readonly andThen: <T>(transformer: (data: D) => T) => Decoder<T>
}

export type Output<T extends Decoder<any>> = ReturnType<T['decode']>
export type Output<T extends Decoder<any>> = ReturnType<T['forceDecode']>

export const createDecoder = <D>(decoder: Decode<D>): Decoder<D> => ({
...decoder,
Expand Down Expand Up @@ -100,7 +100,7 @@ export const literal = <D extends string | number | boolean>(literal: D): Decode
checkDefined(data)
if (data !== literal) {
throw new DecoderError(
`Data does not match the literal. Expected: '${literal as string}', actual: '${show(data)}'`
`Data does not match the literal. Expected: '${literal as string}', actual: '${show(data)}'`
)
}
return data as D
Expand Down

0 comments on commit 54ca869

Please sign in to comment.