Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Korolevskii committed Aug 31, 2022
1 parent 0997db2 commit e503421
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/authutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,22 @@ function writeFeedToFile(
const packageSources = json.configuration.packageSources.add;

if (Array.isArray(packageSources)) {
packageSources.forEach((source) => {
const value = source["@_value"];
packageSources.forEach(source => {
const value = source['@_value'];
core.debug(`source '${value}'`);
if (value.toLowerCase().includes(feedUrl.toLowerCase())) {
const key = source["@_key"];
const key = source['@_key'];
sourceKeys.push(key);
core.debug(`Found a URL with key ${key}`);
}
});
} else {
if (packageSources["@_value"].toLowerCase().includes(feedUrl.toLowerCase())) {
const key = packageSources["@_key"];
if (
packageSources['@_value']
.toLowerCase()
.includes(feedUrl.toLowerCase())
) {
const key = packageSources['@_key'];
sourceKeys.push(key);
core.debug(`Found a URL with key ${key}`);
}
Expand Down

0 comments on commit e503421

Please sign in to comment.