(locator: Locator)
| 114 | } |
| 115 | |
| 116 | getPackageManagerSpecFor(locator: Locator): PackageManagerSpec { |
| 117 | if (!corepackUtils.isSupportedPackageManagerLocator(locator)) { |
| 118 | const url = `${locator.reference}`; |
| 119 | return { |
| 120 | url, |
| 121 | bin: undefined as any, // bin will be set later |
| 122 | registry: { |
| 123 | type: `url`, |
| 124 | url, |
| 125 | fields: { |
| 126 | tags: ``, |
| 127 | versions: ``, |
| 128 | }, |
| 129 | }, |
| 130 | }; |
| 131 | } |
| 132 | |
| 133 | const definition = this.config.definitions[locator.name as SupportedPackageManagers]; |
| 134 | if (typeof definition === `undefined`) |
| 135 | throw new UsageError(`This package manager (${locator.name}) isn't supported by this corepack build`); |
| 136 | |
| 137 | const ranges = Object.keys(definition.ranges).reverse(); |
| 138 | const range = ranges.find(range => semverUtils.satisfiesWithPrereleases(locator.reference, range)); |
| 139 | if (typeof range === `undefined`) |
| 140 | throw new Error(`Assertion failed: Specified resolution (${locator.reference}) isn't supported by any of ${ranges.join(`, `)}`); |
| 141 | |
| 142 | return definition.ranges[range]; |
| 143 | } |
| 144 | |
| 145 | getBinariesFor(name: SupportedPackageManagers) { |
| 146 | const binNames = new Set<string>(); |
no outgoing calls
no test coverage detected