From 24463bd38775951122e6b31fc95f372b57264b8e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 7 Aug 2024 10:51:40 +0200 Subject: [PATCH] Add helper --- packages/types/src/sdk/search.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/types/src/sdk/search.ts b/packages/types/src/sdk/search.ts index 11bfb12b12..6feea40766 100644 --- a/packages/types/src/sdk/search.ts +++ b/packages/types/src/sdk/search.ts @@ -28,6 +28,12 @@ export enum LogicalOperator { OR = "$or", } +export function isLogicalSearchOperator( + value: string +): value is LogicalOperator { + return value === LogicalOperator.AND || value === LogicalOperator.OR +} + export type SearchFilterOperator = | BasicOperator | ArrayOperator