(filepath: string)
| 532 | const moduleContext = lazyModuleContext |
| 533 | |
| 534 | const evaluateInContext = (filepath: string) => { |
| 535 | if (!moduleContext.paths.has(filepath)) { |
| 536 | const content = readFileSync(filepath, 'utf-8') |
| 537 | try { |
| 538 | runInContext(content, moduleContext.runtime.context, { |
| 539 | filename: filepath, |
| 540 | }) |
| 541 | moduleContext.paths.set(filepath, content) |
| 542 | } catch (error) { |
| 543 | if (options.useCache) { |
| 544 | moduleContext?.paths.delete(filepath) |
| 545 | } |
| 546 | throw error |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | return { ...moduleContext, evaluateInContext } |
| 552 | } |
no test coverage detected