MCPcopy
hub / github.com/microsoft/reflect-metadata / script

Function script

test/vm.ts:51–61  ·  view source on GitHub ↗
(context: vm.Context = {})

Source from the content-addressed store, hash-verified

49}
50
51export function script(context: vm.Context = {}): (array: TemplateStringsArray, ...args: any[]) => any{
52 return (array, ...args) => {
53 let code = array[0];
54 for (let i = 1; i < array.length; i++) {
55 code += args[i - 1];
56 code += array[i];
57 }
58 const loader = new Loader(context);
59 return loader.load("test.js", __filename, code);
60 };
61}

Calls 1

loadMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…