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

refactor(pip): expand matches logic

parent 775b2979
No related merge requests found
......@@ -20,14 +20,16 @@ function extractDependencies(content) {
.map((line, lineNumber) => {
regex.lastIndex = 0;
const matches = regex.exec(line);
return (
matches && {
depName: matches[1],
currentValue: matches[2],
lineNumber,
versionScheme: 'pep440',
}
);
if (!matches) {
return null;
}
const [, depName, currentValue] = matches;
return {
depName,
currentValue,
lineNumber,
versionScheme: 'pep440',
};
})
.filter(Boolean);
if (!deps.length) {
......
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