Fix url.escape

This commit is contained in:
Adria Navarro 2024-02-01 11:57:22 +01:00
parent 1b88700d02
commit d1cf13707d
1 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import tracer from "dd-trace"
import fs from "fs"
import url from "url"
import crypto from "crypto"
import querystring from "querystring"
const helpersSource = fs.readFileSync(
`${require.resolve("@budibase/string-templates/index-helpers")}`,
@ -39,6 +40,10 @@ export function init() {
resolve: (...params) => urlResolveCb(...params),
parse: (...params) => urlParseCb(...params),
}
case "querystring":
return {
escape: (...params) => querystringEscapeCb(...params),
}
}
};`
@ -57,6 +62,14 @@ export function init() {
)
)
global.setSync(
"querystringEscapeCb",
new ivm.Callback(
(...params: Parameters<typeof querystring.escape>) =>
querystring.escape(...params)
)
)
const helpersModule = jsIsolate.compileModuleSync(
`${injectedRequire};${helpersSource}`
)