refactor: dedupe string list helpers

This commit is contained in:
Peter Steinberger
2026-04-07 04:16:54 +01:00
parent 80a37ef32a
commit 59eb291c6e
6 changed files with 30 additions and 47 deletions

View File

@@ -1,3 +1,4 @@
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/text-runtime";
import {
type BrowserConfig,
type BrowserProfileConfig,
@@ -116,9 +117,7 @@ function normalizeStringList(raw: string[] | undefined): string[] | undefined {
if (!Array.isArray(raw) || raw.length === 0) {
return undefined;
}
const values = raw
.map((value) => value.trim())
.filter((value): value is string => value.length > 0);
const values = normalizeTrimmedStringList(raw);
return values.length > 0 ? values : undefined;
}