test: simplify setup allowlist normalization · openclaw/openclaw@019d724
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,9 +58,16 @@ vi.mock("openclaw/plugin-sdk/setup", async () => {
|
58 | 58 | ...actual, |
59 | 59 | DEFAULT_ACCOUNT_ID, |
60 | 60 | normalizeAccountId: (value?: string | null) => value?.trim() || DEFAULT_ACCOUNT_ID, |
61 | | -normalizeAllowFromEntries: (entries: string[], normalize: (value: string) => string) => [ |
62 | | - ...new Set(entries.map((entry) => (entry === "*" ? "*" : normalize(entry))).filter(Boolean)), |
63 | | -], |
| 61 | +normalizeAllowFromEntries: (entries: string[], normalize: (value: string) => string) => { |
| 62 | +const normalized = new Set<string>(); |
| 63 | +for (const entry of entries) { |
| 64 | +const value = entry === "*" ? "*" : normalize(entry); |
| 65 | +if (value) { |
| 66 | +normalized.add(value); |
| 67 | +} |
| 68 | +} |
| 69 | +return [...normalized]; |
| 70 | +}, |
64 | 71 | normalizeE164, |
65 | 72 | pathExists: hoisted.pathExists, |
66 | 73 | splitSetupEntries: (raw: string) => |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。