* Returns the package configuration for the given resolved URL. * @param {URL | string} resolved - The resolved URL. * @returns {import('typings/internalBinding/modules').PackageConfig} - The package configuration.
(resolved)
| 190 | * @returns {import('typings/internalBinding/modules').PackageConfig} - The package configuration. |
| 191 | */ |
| 192 | function getPackageScopeConfig(resolved) { |
| 193 | const result = modulesBinding.getPackageScopeConfig(`${resolved}`); |
| 194 | |
| 195 | if (ArrayIsArray(result)) { |
| 196 | const { data, exists, path } = deserializePackageJSON(`${resolved}`, result); |
| 197 | |
| 198 | return { |
| 199 | __proto__: null, |
| 200 | ...data, |
| 201 | exists, |
| 202 | pjsonPath: path, |
| 203 | }; |
| 204 | } |
| 205 | |
| 206 | // This means that the response is a string |
| 207 | // and it is the path to the package.json file |
| 208 | return { |
| 209 | __proto__: null, |
| 210 | pjsonPath: result, |
| 211 | exists: false, |
| 212 | type: 'none', |
| 213 | }; |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Returns the package type for a given URL. |
no test coverage detected
searching dependent graphs…