test: simplify plugin tool argument parsing · openclaw/openclaw@de651aa
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -126,12 +126,18 @@ function splitTopLevelArgs(args: string): string[] {
|
126 | 126 | continue; |
127 | 127 | } |
128 | 128 | if (char === "," && depth === 0) { |
129 | | -parts.push(args.slice(start, index).trim()); |
| 129 | +const part = args.slice(start, index).trim(); |
| 130 | +if (part.length > 0) { |
| 131 | +parts.push(part); |
| 132 | +} |
130 | 133 | start = index + 1; |
131 | 134 | } |
132 | 135 | } |
133 | | -parts.push(args.slice(start).trim()); |
134 | | -return parts.filter(Boolean); |
| 136 | +const part = args.slice(start).trim(); |
| 137 | +if (part.length > 0) { |
| 138 | +parts.push(part); |
| 139 | +} |
| 140 | +return parts; |
135 | 141 | } |
136 | 142 | |
137 | 143 | function extractStringLiterals(source: string): string[] { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。