mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
refactor(pip): expand matches logic
This commit is contained in:
parent
775b2979eb
commit
c2c50222cc
1 changed files with 10 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue