(options)
| 28 | const toNamespace = (mod) => |
| 29 | nodeVm.Module && mod instanceof nodeVm.Module ? mod.namespace : mod; |
| 30 | const wrapDynamicImport = (options) => { |
| 31 | if (!options || typeof options.importModuleDynamically !== "function") { |
| 32 | return options; |
| 33 | } |
| 34 | const original = options.importModuleDynamically; |
| 35 | return { |
| 36 | ...options, |
| 37 | importModuleDynamically(...args) { |
| 38 | const result = original.apply(this, args); |
| 39 | return result && typeof result.then === "function" |
| 40 | ? result.then(toNamespace) |
| 41 | : toNamespace(result); |
| 42 | } |
| 43 | }; |
| 44 | }; |
| 45 | const originalCompileFunction = nodeVm.compileFunction; |
| 46 | nodeVm.compileFunction = function compileFunction(code, params, options) { |
| 47 | return originalCompileFunction.call( |
no outgoing calls
no test coverage detected