Skip to content
Snippets Groups Projects
Commit fe72dc0c authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: packagist registryUrls

parent 4b387934
No related branches found
No related tags found
No related merge requests found
......@@ -245,10 +245,11 @@ async function packageLookup(regUrl, name) {
async function getPkgReleases(purl, config = {}) {
const { fullname: name } = purl;
const { registryUrls } = config;
logger.trace(`getPkgReleases(${name})`);
const regUrls = [];
if (config.registryUrls) {
for (const regUrl of config.registryUrls) {
if (registryUrls) {
for (const regUrl of registryUrls) {
if (regUrl.type === 'composer') {
regUrls.push(regUrl.url);
} else if (regUrl.type === 'package') {
......@@ -262,9 +263,8 @@ async function getPkgReleases(purl, config = {}) {
logger.debug({ regUrls }, 'Packagist custom registry URLs');
}
if (
!is.nonEmptyArray(config.registryUrls) ||
config.registryUrls[config.registryUrls.length - 1]['packagist.org'] !==
false
!is.nonEmptyArray(registryUrls) ||
registryUrls[registryUrls.length - 1]['packagist.org'] !== false
) {
regUrls.push('https://packagist.org');
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment