throwError
throwError variable
throw result of toError
Signature:
throwError: <T, E extends Error>(toError: (input: T) => E) => (input: T) => never
Example
const result: never = pipe(
0,
throwError((input) => Error(`input is ${input}`)),
(input: never) => {
// unreachable point
},
);