From 5cafd3ba42ab68742f4f70d905764e9cd35b18e5 Mon Sep 17 00:00:00 2001 From: Younes JAAIDI Date: Wed, 16 Oct 2019 11:08:45 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=85=20fail=20if=20matchOrigin=20i?= =?UTF-8?q?s=20given=20an=20valid=20match=20expression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matchers/match-origin/origin-predicate-matcher.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/http-ext/src/lib/matchers/match-origin/origin-predicate-matcher.ts b/libs/http-ext/src/lib/matchers/match-origin/origin-predicate-matcher.ts index 52c432d95..69c6a7ff7 100644 --- a/libs/http-ext/src/lib/matchers/match-origin/origin-predicate-matcher.ts +++ b/libs/http-ext/src/lib/matchers/match-origin/origin-predicate-matcher.ts @@ -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); } };