MCPcopy Create free account
hub / github.com/error311/FileRise / buildPortalUsernamePreview

Function buildPortalUsernamePreview

public/js/adminPortals.js:606–620  ·  view source on GitHub ↗
(slug)

Source from the content-addressed store, hash-verified

604}
605
606function buildPortalUsernamePreview(slug) {
607 const raw = String(slug || '').trim();
608 let clean = raw.replace(/[^A-Za-z0-9_-]+/g, '-');
609 clean = clean.replace(/^[-_]+|[-_]+$/g, '');
610 let lower = clean.toLowerCase();
611 if (lower.startsWith('portal-')) {
612 lower = lower.slice(7);
613 } else if (lower === 'portal') {
614 lower = '';
615 }
616 if (!lower) {
617 return 'portal_user';
618 }
619 return 'portal_' + lower;
620}
621
622function isPortalExpiredDate(expiresAt) {
623 const raw = String(expiresAt || '').trim();

Callers 1

loadClientPortalsListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected