()
| 865 | } |
| 866 | |
| 867 | function resolvePgModulePath(): string { |
| 868 | const candidates = [ |
| 869 | join(resolveRepositoryRoot(), "packages", "db", "package.json"), |
| 870 | resolveLocalDbPackageJsonPath(), |
| 871 | ]; |
| 872 | let lastError: unknown; |
| 873 | for (const candidate of candidates) { |
| 874 | try { |
| 875 | return createRequire(candidate).resolve("pg"); |
| 876 | } catch (error) { |
| 877 | lastError = error; |
| 878 | } |
| 879 | } |
| 880 | throw lastError instanceof Error ? lastError : new Error("Could not resolve pg module."); |
| 881 | } |
| 882 | |
| 883 | function normalizeFsPath(pathname: string): string { |
| 884 | return pathname.startsWith("/@fs/") ? pathname.slice("/@fs".length) : pathname; |
no test coverage detected