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

Function applySurgeArgumentsDesc

Rewrite-Parser.beta.js:2381–2393  ·  view source on GitHub ↗
(args, rawDesc)

Source from the content-addressed store, hash-verified

2379}
2380
2381function applySurgeArgumentsDesc(args, rawDesc) {
2382 const descMap = parseSurgeArgumentsDesc(
2383 rawDesc,
2384 args.map(item => item.key)
2385 )
2386 args.forEach(item => {
2387 const desc = descMap[item.key]
2388 if (!desc) return
2389 const { tag } = parseArgumentTagFields(item.tag)
2390 const firstLine = desc.split(/\r?\n/)[0].trim()
2391 item.tag = `tag=${tag && tag !== item.key ? tag : firstLine || item.key}, desc=${escapeArgumentDesc(desc)}`
2392 })
2393}
2394
2395function rewriteArgumentTagKey(tag, oldKey, newKey) {
2396 if (!tag || oldKey === newKey) return tag

Callers 1

Calls 3

parseSurgeArgumentsDescFunction · 0.85
parseArgumentTagFieldsFunction · 0.85
escapeArgumentDescFunction · 0.85

Tested by

no test coverage detected