startsWith and endsWith query functions

pull/612/head
Zef Hemel 2023-12-21 18:21:27 +01:00
parent 62d55e11ff
commit 30624a8112
1 changed files with 6 additions and 0 deletions

View File

@ -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);