MCPcopy
hub / github.com/anomalyco/opencode / normalizeCode

Function normalizeCode

packages/console/core/src/referral.ts:21–26  ·  view source on GitHub ↗
(code?: string | null)

Source from the content-addressed store, hash-verified

19 export const CODE_LENGTH = 10
20
21 export function normalizeCode(code?: string | null) {
22 return code
23 ?.toUpperCase()
24 .replace(/[^A-Z0-9]/g, "")
25 .slice(0, CODE_LENGTH)
26 }
27
28 function generateCode() {
29 return ulid().slice(-CODE_LENGTH).toUpperCase()

Callers 1

createFromAccountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected