MCPcopy Create free account
hub / github.com/Roy3838/Observer / normalizeWhitelistCode

Function normalizeWhitelistCode

app/src/utils/whitelistCode.ts:68–72  ·  view source on GitHub ↗
(text: string | null | undefined)

Source from the content-addressed store, hash-verified

66 * so anything this rejects (e.g. a raw phone number) can never be sent to.
67 */
68export function normalizeWhitelistCode(text: string | null | undefined): string | null {
69 if (!text) return null;
70 const parts = text.trim().toLowerCase().split(/[\s-]+/).filter(Boolean);
71 return parts.length === 4 && parts.every(p => WORDS.has(p)) ? parts.join('-') : null;
72}

Callers 6

WhitelistModalFunction · 0.90
CheckWhitelistGateFunction · 0.90
checkPhoneWhitelistFunction · 0.90
contactValidFunction · 0.90
checkContactCodesFunction · 0.90
registry.tsFile · 0.90

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected