MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / formatUserCode

Method formatUserCode

src/modals/DeviceCodeModal.ts:371–380  ·  view source on GitHub ↗

* Formats user code with dashes for readability * e.g., "ABCDEFGH" -> "ABCD-EFGH"

(code: string)

Source from the content-addressed store, hash-verified

369 * e.g., "ABCDEFGH" -> "ABCD-EFGH"
370 */
371 private formatUserCode(code: string): string {
372 // If code already has dashes, return as-is
373 if (code.includes("-")) {
374 return code;
375 }
376
377 // Insert dash in middle for codes without formatting
378 const mid = Math.floor(code.length / 2);
379 return code.slice(0, mid) + "-" + code.slice(mid);
380 }
381
382 /**
383 * Gets human-readable time remaining

Callers 1

onOpenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected