Files
Agent-n8n/n8n-n8n-1.109.2/packages/testing/playwright/utils/url-helper.ts

8 lines
207 B
TypeScript
Raw Normal View History

2025-09-08 04:48:28 +08:00
/**
* 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');
}