(str, keys = [])
| 2345 | } |
| 2346 | |
| 2347 | function parseSurgeArgumentsDescLine(str, keys = []) { |
| 2348 | const line = normalizeArgumentsDescLine(str) |
| 2349 | if (!line) return null |
| 2350 | const keyPattern = keys.length > 0 ? keys.map(escapeRegExp).join('|') : '[^::\\n]+' |
| 2351 | const matched = line.match(new RegExp(`^(${keyPattern})\\s*[::]\\s*([\\s\\S]+)$`)) |
| 2352 | if (!matched) return null |
| 2353 | return { |
| 2354 | key: matched[1].trim(), |
| 2355 | desc: matched[2].trim(), |
| 2356 | } |
| 2357 | } |
| 2358 | |
| 2359 | function parseSurgeArgumentsDesc(str, keys = []) { |
| 2360 | str = `${str ?? ''}`.replace(/\\n/g, '\n') |
no test coverage detected