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

Function normalizeHotmailLocalBaseUrl

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

Source from the content-addressed store, hash-verified

659}
660
661function normalizeHotmailLocalBaseUrl(rawValue = '') {
662 const value = String(rawValue || '').trim();
663 if (!value) return DEFAULT_HOTMAIL_LOCAL_BASE_URL;
664
665 try {
666 const parsed = new URL(value);
667 if (!['http:', 'https:'].includes(parsed.protocol)) {
668 return DEFAULT_HOTMAIL_LOCAL_BASE_URL;
669 }
670
671 if (['/messages', '/code', '/clear', '/token'].includes(parsed.pathname)) {
672 parsed.pathname = '';
673 parsed.search = '';
674 parsed.hash = '';
675 }
676
677 return parsed.toString().replace(/\/$/, '');
678 } catch {
679 return DEFAULT_HOTMAIL_LOCAL_BASE_URL;
680 }
681}
682
683function normalizeAccountRunHistoryHelperBaseUrl(rawValue = '') {
684 const value = String(rawValue || '').trim();

Calls

no outgoing calls

Tested by

no test coverage detected