(includer: string, inc: string)
| 509 | // project root. Returns a project-root-relative path that exists on disk |
| 510 | // (even if it was never indexed — e.g. redis' generated `commands.def`). |
| 511 | const resolveInclude = (includer: string, inc: string): string | null => { |
| 512 | const dir = path.posix.dirname(includer.replace(/\\/g, '/')); |
| 513 | const cand = path.posix.normalize(path.posix.join(dir, inc)); |
| 514 | if (ctx.fileExists(cand)) return cand; |
| 515 | if (ctx.fileExists(inc)) return inc; |
| 516 | return null; |
| 517 | }; |
| 518 | |
| 519 | // Retained strings are interned through here. Regex captures off a big file |
| 520 | // string are V8 sliced strings — retaining one pins the whole parent file |
no test coverage detected