From e5034212c9571ae08b710f89bb4f370ec343e0a5 Mon Sep 17 00:00:00 2001 From: Evgenii Korolevskii Date: Wed, 31 Aug 2022 15:41:59 +0200 Subject: [PATCH] refactoring --- src/authutil.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/authutil.ts b/src/authutil.ts index d88c347..486f40f 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -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}`); }