()
| 84 | } |
| 85 | |
| 86 | function pkgForSomeOtherPlatform(): string | null { |
| 87 | const libMainJS = require.resolve('esbuild') |
| 88 | const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))) |
| 89 | |
| 90 | if (path.basename(nodeModulesDirectory) === 'node_modules') { |
| 91 | for (const unixKey in knownUnixlikePackages) { |
| 92 | try { |
| 93 | const pkg = knownUnixlikePackages[unixKey] |
| 94 | if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg |
| 95 | } catch { |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | for (const windowsKey in knownWindowsPackages) { |
| 100 | try { |
| 101 | const pkg = knownWindowsPackages[windowsKey] |
| 102 | if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg |
| 103 | } catch { |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | return null |
| 109 | } |
| 110 | |
| 111 | export function downloadedBinPath(pkg: string, subpath: string): string { |
| 112 | const esbuildLibDir = path.dirname(require.resolve('esbuild')) |
no test coverage detected
searching dependent graphs…