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) => {
|
.map((line, lineNumber) => {
|
||||||
regex.lastIndex = 0;
|
regex.lastIndex = 0;
|
||||||
const matches = regex.exec(line);
|
const matches = regex.exec(line);
|
||||||
return (
|
if (!matches) {
|
||||||
matches && {
|
return null;
|
||||||
depName: matches[1],
|
}
|
||||||
currentValue: matches[2],
|
const [, depName, currentValue] = matches;
|
||||||
|
return {
|
||||||
|
depName,
|
||||||
|
currentValue,
|
||||||
lineNumber,
|
lineNumber,
|
||||||
versionScheme: 'pep440',
|
versionScheme: 'pep440',
|
||||||
}
|
};
|
||||||
);
|
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
if (!deps.length) {
|
if (!deps.length) {
|
||||||
|
|
Loading…
Reference in a new issue