Add is_nullish operator

Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: antonk52

Differential Revision: D49230135

fbshipit-source-id: 1f7d88512eb3ed592eb406f0950ffa0c6985772c
This commit is contained in:
Andrey Goncharov
2023-09-14 04:48:12 -07:00
committed by Facebook GitHub Bot
parent 75884674e0
commit 3a4dada2fc

View File

@@ -111,6 +111,11 @@ export const dataTablePowerSearchOperators = {
valueType: 'ENUM_SET', valueType: 'ENUM_SET',
enumLabels, enumLabels,
}), }),
is_nullish: () => ({
label: 'is nullish',
key: 'is_nullish',
valueType: 'NO_VALUE',
}),
} satisfies { } satisfies {
[key: string]: (...args: any[]) => OperatorConfig; [key: string]: (...args: any[]) => OperatorConfig;
}; };
@@ -169,4 +174,5 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
searchValue.some((item) => value === item), searchValue.some((item) => value === item),
enum_set_is_none_of: (_operator, searchValue: string[], value: string) => enum_set_is_none_of: (_operator, searchValue: string[], value: string) =>
!searchValue.some((item) => value === item), !searchValue.some((item) => value === item),
is_nullish: (_operator, _searchValue, value) => value == null,
} satisfies PowerSearchOperatorProcessorConfig; } satisfies PowerSearchOperatorProcessorConfig;