Files
n8n-enterprise-unlocked/packages/testing/playwright/utils/url-helper.ts
2025-08-04 19:59:06 +01:00

8 lines
207 B
TypeScript

/**
* Extract port from a URL string
*/
export function getPortFromUrl(url: string): string {
const parsedUrl = new URL(url);
return parsedUrl.port || (parsedUrl.protocol === 'https:' ? '443' : '80');
}