diff --git a/packages/server/src/utilities/scriptRunner.ts b/packages/server/src/utilities/scriptRunner.ts index e6df8fa829..616e787d90 100644 --- a/packages/server/src/utilities/scriptRunner.ts +++ b/packages/server/src/utilities/scriptRunner.ts @@ -7,7 +7,7 @@ class ScriptRunner { constructor(script: string, context: any) { const code = `let fn = () => {\n${script}\n}; results.out = fn();` - this.vm = new IsolatedVM(8) + this.vm = new IsolatedVM({ memoryLimit: 8 }) this.vm.context = { data: context.data, params: context.params, @@ -29,7 +29,7 @@ class IsolatedVM { jail: ivm.Reference script: any - constructor(memoryLimit: number) { + constructor({ memoryLimit }: { memoryLimit: number }) { this.isolate = new ivm.Isolate({ memoryLimit }) this.vm = this.isolate.createContextSync() this.jail = this.vm.global