MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / normalizeEfunCode

Function normalizeEfunCode

static/js/payment.js:1663–1675  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

1661}
1662
1663function normalizeEfunCode(raw) {
1664 const compact = String(raw || "")
1665 .toUpperCase()
1666 .replace(/[^A-Z0-9]/g, "");
1667 if (!compact.startsWith("UK")) {
1668 return String(raw || "").trim().toUpperCase().replace(/\s+/g, "");
1669 }
1670 const body = compact.slice(2);
1671 if (body.length !== 25) {
1672 return String(raw || "").trim().toUpperCase().replace(/\s+/g, "");
1673 }
1674 return `UK-${body.slice(0, 5)}-${body.slice(5, 10)}-${body.slice(10, 15)}-${body.slice(15, 20)}-${body.slice(20, 25)}`;
1675}
1676
1677function safeJsonParse(raw, fallback) {
1678 try {

Callers 8

loadCardPoolRedeemCodesFunction · 0.85
renderEfunPoolHintFunction · 0.85
markCardPoolCodeUsedFunction · 0.85
collectEfunConfigFunction · 0.85
redeemEfunAndFillFunction · 0.85
restoreBindModeConfigFunction · 0.85
payment.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected