MCPcopy
hub / github.com/electerm/electerm / sanitizeFilename

Function sanitizeFilename

npm/install.js:44–52  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

42}
43
44function sanitizeFilename (name) {
45 const clean = String(name).trim()
46 if (!/^[\w.-]+$/.test(clean)) {
47 throw new Error(
48 `Refusing to continue: remote filename failed validation: "${name}"`
49 )
50 }
51 return clean
52}
53
54// ---------------------------------------------------------------------------
55// Core helpers

Callers 3

runMacFunction · 0.70
runMac10Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected