Skip to content

Commit

Permalink
feat: ✅ fail if matchOrigin is given an valid match expression
Browse files Browse the repository at this point in the history
  • Loading branch information
yjaaidi committed Oct 16, 2019
1 parent 91f2c0d commit 5cafd3b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ export const originPredicateMatcher: OriginMatcher = {
canHandle(matchExpression) {
return isFunction(matchExpression);
},
handle({ origin, matchExpression }) {
return (matchExpression as Function)(origin);
handle({
origin,
matchExpression
}: {
origin: string;
matchExpression: MatchOriginPredicate;
}) {
return matchExpression(origin);
}
};

0 comments on commit 5cafd3b

Please sign in to comment.