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

Function getSurgeArgumentDefault

Rewrite-Parser.beta.js:2112–2117  ·  view source on GitHub ↗
(item, isRuleToggle = false)

Source from the content-addressed store, hash-verified

2110}
2111
2112function getSurgeArgumentDefault(item, isRuleToggle = false) {
2113 const value = `${item.value ?? ''}`.trim()
2114 if (isRuleToggle) return getSwitchDefault(value) == 'true' ? '' : '#'
2115 if (item.type == 'switch') return getSwitchDefault(value)
2116 return quoteIfNeeded(splitTopLevel(value, ',')[0] || value)
2117}
2118
2119function formatLoonArgumentValue(item, type = item.type, isRuleToggle = false) {
2120 const value = `${item.value ?? ''}`.trim()

Callers 1

Calls 3

getSwitchDefaultFunction · 0.85
quoteIfNeededFunction · 0.85
splitTopLevelFunction · 0.85

Tested by

no test coverage detected