mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
refactor: dedupe string list helpers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user