MCPcopy
hub / github.com/electerm/electerm / sanitizeVersion

Function sanitizeVersion

npm/install.js:34–42  ·  view source on GitHub ↗
(ver)

Source from the content-addressed store, hash-verified

32// ---------------------------------------------------------------------------
33
34function sanitizeVersion (ver) {
35 const clean = String(ver).trim().replace(/^v/, '')
36 if (!/^\d+\.\d+\.\d+$/.test(clean)) {
37 throw new Error(
38 `Refusing to continue: remote version string failed validation: "${ver}"`
39 )
40 }
41 return clean
42}
43
44function sanitizeFilename (name) {
45 const clean = String(name).trim()

Callers 4

runLinuxFunction · 0.85
runWinFunction · 0.85
runWin7Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected