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