1
0

startsWith and endsWith query functions

This commit is contained in:
Zef Hemel 2023-12-21 18:21:27 +01:00
parent 62d55e11ff
commit 30624a8112

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