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

Function getSurgeTemplateArgumentKeys

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

Source from the content-addressed store, hash-verified

2221}
2222
2223function getSurgeTemplateArgumentKeys(str) {
2224 str = stripWrapQuote(str)
2225 if (!/\{\{\{[^{}]+\}\}\}/.test(str)) return []
2226 return splitTopLevel(str, '&')
2227 .map(item => {
2228 const matched = item.match(/^\s*([^=\s]+)\s*=\s*"?\{\{\{([^{}]+)\}\}\}"?\s*$/)
2229 return matched && matched[1].trim() === matched[2].trim() ? matched[1].trim() : ''
2230 })
2231 .filter(Boolean)
2232}
2233
2234function parseSurgeTemplateArgumentPairs(str, renameMap = argumentKeyRenameMap) {
2235 str = stripWrapQuote(str)

Callers 1

normalizeScriptArgumentFunction · 0.85

Calls 2

stripWrapQuoteFunction · 0.85
splitTopLevelFunction · 0.85

Tested by

no test coverage detected