From 5b11ec3e99169e9a99c6c07f6ba49fd36d290a12 Mon Sep 17 00:00:00 2001 From: Alex Pimenov Date: Thu, 26 Jan 2023 13:40:19 +0100 Subject: [PATCH] make isAnyOf friendly for mapped matchers, but making argument optional --- packages/toolkit/src/matchers.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/toolkit/src/matchers.ts b/packages/toolkit/src/matchers.ts index fca137e87d..5c7b9ebf36 100644 --- a/packages/toolkit/src/matchers.ts +++ b/packages/toolkit/src/matchers.ts @@ -13,12 +13,12 @@ import type { /** @public */ export type ActionMatchingAnyOf< - Matchers extends [Matcher, ...Matcher[]] + Matchers extends [...Matcher[]] > = ActionFromMatcher /** @public */ export type ActionMatchingAllOf< - Matchers extends [Matcher, ...Matcher[]] + Matchers extends [...Matcher[]] > = UnionToIntersection> const matches = (matcher: Matcher, action: any) => { @@ -38,7 +38,7 @@ const matches = (matcher: Matcher, action: any) => { * * @public */ -export function isAnyOf, ...Matcher[]]>( +export function isAnyOf[]]>( ...matchers: Matchers ) { return (action: any): action is ActionMatchingAnyOf => { @@ -55,7 +55,7 @@ export function isAnyOf, ...Matcher[]]>( * * @public */ -export function isAllOf, ...Matcher[]]>( +export function isAllOf[]]>( ...matchers: Matchers ) { return (action: any): action is ActionMatchingAllOf => {