2018-06-02 17:36:12 +00:00
|
|
|
const semver = require('../../versioning/semver');
|
|
|
|
|
2018-03-04 14:52:06 +00:00
|
|
|
module.exports = {
|
|
|
|
extractDependencies,
|
|
|
|
};
|
|
|
|
|
2018-05-03 16:09:18 +00:00
|
|
|
function extractDependencies(content) {
|
2018-06-02 17:36:12 +00:00
|
|
|
const dep = {
|
|
|
|
depName: 'node',
|
2018-06-04 03:48:20 +00:00
|
|
|
currentValue: content.trim(),
|
2018-06-11 05:15:54 +00:00
|
|
|
purl: 'pkg:github/nodejs/node?sanitize=true',
|
2018-06-03 17:13:39 +00:00
|
|
|
versionScheme: 'semver',
|
2018-06-02 17:36:12 +00:00
|
|
|
};
|
2018-06-04 04:03:21 +00:00
|
|
|
if (!semver.isVersion(dep.currentValue)) {
|
2018-06-02 17:36:12 +00:00
|
|
|
dep.skipReason = 'unsupported-version';
|
|
|
|
}
|
|
|
|
return { deps: [dep] };
|
2018-03-04 14:52:06 +00:00
|
|
|
}
|