refactor: share trimmed string entry normalization

This commit is contained in:
Peter Steinberger
2026-03-07 23:11:04 +00:00
parent 6647d02846
commit d228a62143
12 changed files with 29 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
import type { OpenClawConfig } from "../config/config.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import { projectSafeChannelAccountSnapshotFields } from "./account-snapshot-fields.js";
import type { ChannelAccountSnapshot } from "./plugins/types.core.js";
import type { ChannelPlugin } from "./plugins/types.plugin.js";
@@ -34,7 +35,7 @@ export function formatChannelAllowFrom(params: {
allowFrom: params.allowFrom,
});
}
return params.allowFrom.map((entry) => String(entry).trim()).filter(Boolean);
return normalizeStringEntries(params.allowFrom);
}
function asRecord(value: unknown): Record<string, unknown> | undefined {