(resolution)
| 89 | } |
| 90 | |
| 91 | function parseResolution(resolution) { |
| 92 | // resolution format: "<name>@npm:<version>" |
| 93 | const match = resolution.match(/^(.+)@npm:(.+)$/); |
| 94 | if (!match) return null; |
| 95 | return { name: match[1], version: match[2] }; |
| 96 | } |
| 97 | |
| 98 | async function fetchLicense(name, version) { |
| 99 | const url = `${NPM_REGISTRY}/${encodeURIComponent(name).replace("%40", "@")}/${version}`; |