MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / quoteIfNeeded

Function quoteIfNeeded

Rewrite-Parser.beta.js:2087–2091  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2085}
2086
2087function quoteIfNeeded(str) {
2088 str = `${str ?? ''}`.trim()
2089 if (/^'.*'$/.test(str)) str = `"${str.slice(1, -1)}"`
2090 return /[\s,]/.test(str) && !/^".*"$/.test(str) ? `"${str}"` : str
2091}
2092
2093function quoteLoonInputValue(str) {
2094 str = stripWrapQuote(`${str ?? ''}`.trim())

Callers 1

getSurgeArgumentDefaultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected