MCPcopy Create free account
hub / github.com/codeHappyDananx/SpecWave / normalizeImagePrefix

Function normalizeImagePrefix

electron/main.js:1049–1054  ·  view source on GitHub ↗
(prefix)

Source from the content-addressed store, hash-verified

1047const PASTE_IMAGE_DIR = '.terminal-paste'
1048
1049function normalizeImagePrefix(prefix) {
1050 const raw = String(prefix || PASTE_IMAGE_PREFIX)
1051 const cleaned = raw.replace(/[^a-zA-Z0-9-_]/g, '')
1052 if (!cleaned) return PASTE_IMAGE_PREFIX
1053 return cleaned.endsWith('-') ? cleaned : `${cleaned}-`
1054}
1055
1056function padNumber(value, width) {
1057 return String(value).padStart(width, '0')

Callers 1

saveClipboardImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected