test: simplify plugin sdk export parsing · openclaw/openclaw@17c1ee1
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,12 +18,12 @@ async function collectRuntimeExports(filePath: string, seen = new Set<string>())
|
18 | 18 | const exportNames = new Set<string>(); |
19 | 19 | |
20 | 20 | for (const match of source.matchAll(/export\s+(?!type\b)\{([\s\S]*?)\}\s+from\s+"([^"]+)";/g)) { |
21 | | -const names = match[1] |
22 | | -.split(",") |
23 | | -.map((part) => part.trim()) |
24 | | -.filter(Boolean) |
25 | | -.map((part) => part.split(/\s+as\s+/).at(-1) ?? part); |
26 | | -for (const name of names) { |
| 21 | +for (const part of match[1].split(",")) { |
| 22 | +const trimmed = part.trim(); |
| 23 | +if (trimmed.length === 0) { |
| 24 | + continue; |
| 25 | +} |
| 26 | + const name = trimmed.split(/\s+as\s+/).at(-1) ?? trimmed; |
27 | 27 | exportNames.add(name); |
28 | 28 | } |
29 | 29 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。