Skip to content

Commit

Permalink
fix: fix implementation of isCaseHandler
Browse files Browse the repository at this point in the history
`isCaseHandler` was not calling the passed-in function properly by spreading the arguments.
  • Loading branch information
derrickbeining committed Dec 8, 2019
1 parent c9c33fd commit 538dade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tagged-union.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function isPartialCaseOfStruct<D extends Def<string, AnyTuple>, R>(
function isCaseHandler<T extends AnyTuple, R>(f: unknown, ...v: T): f is (...val: T) => R {
if (typeof f === 'function') {
try {
f(v)
f(...v)
return true
} catch (e) {
/* istanbul ignore next */
Expand Down

0 comments on commit 538dade

Please sign in to comment.