001-drive-proxy-adapter #1

Merged
Peter.Morton merged 25 commits from 001-drive-proxy-adapter into main 2026-03-07 12:45:57 -06:00
Showing only changes of commit 6df1d49e9a - Show all commits

View File

@@ -89,12 +89,13 @@ function loadGlobalVariableFunctions() {
const code = readFileSync(filePath, "utf-8");
const script = new vm.Script(code, { filename: file });
// Execute in context with crypto and console
// Expects file to return an object via IIFE
// Execute in context with all VM globals and previously loaded variables
// Allows function modules to access same dependencies as proxy.js
const tempContext = vm.createContext({
crypto,
console: logger,
...globalVMContext,
...globalVariableContext,
});
const exportedObject = script.runInContext(tempContext);
globalVariableContext[functionName] = exportedObject;