MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / normalizeHotmailRemoteBaseUrl

Function normalizeHotmailRemoteBaseUrl

background.js:639–659  ·  view source on GitHub ↗
(rawValue = '')

Source from the content-addressed store, hash-verified

637}
638
639function normalizeHotmailRemoteBaseUrl(rawValue = '') {
640 const value = String(rawValue || '').trim();
641 if (!value) return DEFAULT_HOTMAIL_REMOTE_BASE_URL;
642
643 try {
644 const parsed = new URL(value);
645 if (!['http:', 'https:'].includes(parsed.protocol)) {
646 return DEFAULT_HOTMAIL_REMOTE_BASE_URL;
647 }
648
649 if (parsed.pathname.endsWith('/api/mail-new') || parsed.pathname.endsWith('/api/mail-all') || parsed.pathname === '/api.html') {
650 parsed.pathname = '';
651 parsed.search = '';
652 parsed.hash = '';
653 }
654
655 return parsed.toString().replace(/\/$/, '');
656 } catch {
657 return DEFAULT_HOTMAIL_REMOTE_BASE_URL;
658 }
659}
660
661function normalizeHotmailLocalBaseUrl(rawValue = '') {
662 const value = String(rawValue || '').trim();

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected