()
| 19 | }; |
| 20 | |
| 21 | function getPlatformPackageName() { |
| 22 | const key = `${process.platform}-${process.arch}`; |
| 23 | |
| 24 | try { |
| 25 | const parentPkg = JSON.parse( |
| 26 | fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8") |
| 27 | ); |
| 28 | const optDeps = parentPkg.optionalDependencies || {}; |
| 29 | for (const name of Object.keys(optDeps)) { |
| 30 | if (name.endsWith(`-${key}`)) { |
| 31 | return name; |
| 32 | } |
| 33 | } |
| 34 | } catch (_) {} |
| 35 | |
| 36 | return PLATFORM_PKG[key] || null; |
| 37 | } |
| 38 | |
| 39 | function resolveNativeBinary() { |
| 40 | const pkgName = getPlatformPackageName(); |
no outgoing calls
no test coverage detected