refactor: share trimmed list normalization in provider helpers

This commit is contained in:
Peter Steinberger
2026-03-07 23:25:39 +00:00
parent c5bd84309a
commit c9128e1f3f
4 changed files with 14 additions and 4 deletions

View File

@@ -1,7 +1,11 @@
import { resolveAllowlistMatchByCandidates, type AllowlistMatch } from "openclaw/plugin-sdk/matrix";
import {
normalizeStringEntries,
resolveAllowlistMatchByCandidates,
type AllowlistMatch,
} from "openclaw/plugin-sdk/matrix";
function normalizeAllowList(list?: Array<string | number>) {
return (list ?? []).map((entry) => String(entry).trim()).filter(Boolean);
return normalizeStringEntries(list);
}
function normalizeMatrixUser(raw?: string | null): string {