From 30624a8112577f2c59aa4555734d0be011ac64ad Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Thu, 21 Dec 2023 18:21:27 +0100 Subject: [PATCH] startsWith and endsWith query functions --- plug-api/lib/builtin_query_functions.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plug-api/lib/builtin_query_functions.ts b/plug-api/lib/builtin_query_functions.ts index 12ad1a6..dc7644b 100644 --- a/plug-api/lib/builtin_query_functions.ts +++ b/plug-api/lib/builtin_query_functions.ts @@ -14,6 +14,12 @@ export const builtinFunctions: FunctionMap = { toJSON(obj: any) { return JSON.stringify(obj); }, + startsWith(str: string, prefix: string) { + return str.startsWith(prefix); + }, + endsWith(str: string, suffix: string) { + return str.endsWith(suffix); + }, // Note: these assume Monday as the first day of the week firstDayOfWeek(dateString: string): string { const date = new Date(dateString);