mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: catch doesn't need to have a param (no-changelog) (#5614)
This commit is contained in:
committed by
GitHub
parent
9420b0fdf8
commit
4e244937c9
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user