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

Function getTemplateKeys

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

Source from the content-addressed store, hash-verified

2176}
2177
2178function getTemplateKeys(str) {
2179 str = stripWrapQuote(str)
2180 return [
2181 ...[...str.matchAll(/\{\{\{([^{}]+)\}\}\}/g)].map(item => item[1].trim()),
2182 ...[...str.replace(/\{\{\{[^{}]+\}\}\}/g, '').matchAll(/\{([^{}]+)\}/g)].map(item => item[1].trim()),
2183 ].filter(Boolean)
2184}
2185
2186function getArgumentDefaultValue(item) {
2187 const value = `${item?.value ?? ''}`.trim()

Callers 3

collectUsedArgumentKeysFunction · 0.85
getSurgeRuleTogglePrefixFunction · 0.85

Calls 1

stripWrapQuoteFunction · 0.85

Tested by

no test coverage detected