From 5efe92bc6938d5d8c9175bf42e4f3bdeae221a41 Mon Sep 17 00:00:00 2001 From: MiryangJung Date: Fri, 8 Mar 2024 22:25:12 +0900 Subject: [PATCH 1/2] make typeerror when a null value with eq operator from the not filter. --- src/PostgrestFilterBuilder.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PostgrestFilterBuilder.ts b/src/PostgrestFilterBuilder.ts index 21cc4090..fc9b8135 100644 --- a/src/PostgrestFilterBuilder.ts +++ b/src/PostgrestFilterBuilder.ts @@ -474,6 +474,7 @@ export default class PostgrestFilterBuilder< * @param value - The value to filter with, following PostgREST syntax */ not(column: string, operator: string, value: unknown): this { + if (operator === 'eq' && value === null) throw new TypeError('eq operator does not support null value'); this.url.searchParams.append(column, `not.${operator}.${value}`) return this } From 61fe96c8bb621440dd59d9b2c87f72f3d5c05a1f Mon Sep 17 00:00:00 2001 From: MiryangJung Date: Sat, 9 Mar 2024 20:35:31 +0900 Subject: [PATCH 2/2] format --- src/PostgrestFilterBuilder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PostgrestFilterBuilder.ts b/src/PostgrestFilterBuilder.ts index fc9b8135..76e2f284 100644 --- a/src/PostgrestFilterBuilder.ts +++ b/src/PostgrestFilterBuilder.ts @@ -474,7 +474,8 @@ export default class PostgrestFilterBuilder< * @param value - The value to filter with, following PostgREST syntax */ not(column: string, operator: string, value: unknown): this { - if (operator === 'eq' && value === null) throw new TypeError('eq operator does not support null value'); + if (operator === 'eq' && value === null) + throw new TypeError('eq operator does not support null value') this.url.searchParams.append(column, `not.${operator}.${value}`) return this }