refactor: catch doesn't need to have a param (no-changelog) (#5614)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-03-03 18:18:49 +01:00
committed by GitHub
parent 9420b0fdf8
commit 4e244937c9
20 changed files with 59 additions and 59 deletions

View File

@@ -64,7 +64,7 @@ export function getDomainBase(raw: string, urlParts = URL_PARTS_REGEX): string {
const url = new URL(raw);
return [url.protocol, url.hostname].join('//');
} catch (_) {
} catch {
const match = urlParts.exec(raw);
if (!match?.groups?.protocolPlusDomain) return '';
@@ -98,7 +98,7 @@ export function getDomainPath(raw: string, urlParts = URL_PARTS_REGEX): string {
if (!url.hostname) throw new Error('Malformed URL');
return sanitizeRoute(url.pathname);
} catch (_) {
} catch {
const match = urlParts.exec(raw);
if (!match?.groups?.pathname) return '';
@@ -168,7 +168,7 @@ export function generateNodesGraph(
if (node.type === 'n8n-nodes-base.httpRequest' && node.typeVersion === 1) {
try {
nodeItem.domain = new URL(node.parameters.url as string).hostname;
} catch (_) {
} catch {
nodeItem.domain = getDomainBase(node.parameters.url as string);
}
} else if (node.type === 'n8n-nodes-base.httpRequest' && [2, 3].includes(node.typeVersion)) {