renovate/lib/datasource/index.js
Rhys Arkins 124807974a feat(nuget): support changelogs
Refactors nuget lookups to use generatic logic and fill in repositoryUrl to enable changelogs.
2018-06-14 15:52:37 +02:00

31 lines
610 B
JavaScript

const { parse } = require('../util/purl');
const github = require('./github');
const npm = require('./npm');
const nuget = require('./nuget');
const packagist = require('./packagist');
const pypi = require('./pypi');
const datasources = {
github,
npm,
nuget,
packagist,
pypi,
};
function getDependency(purlStr, config) {
const purl = parse(purlStr);
if (!purl) {
return null;
}
if (!datasources[purl.type]) {
logger.warn('Unknown purl type: ' + purl.type);
return null;
}
return datasources[purl.type].getDependency(purl, config);
}
module.exports = {
getDependency,
};