mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-09 08:42:52 +00:00
Extract shared normalization/coercion helpers into private @openclaw/normalization-core workspace package while preserving existing plugin SDK helper subpaths.\n\nAlso keeps direct normalization-core imports internal, wires UI/build/loader resolution, and replaces the slow PR network CodeQL lane with a fast added-line boundary scan while retaining full CodeQL for scheduled/manual runs.\n\nVerification: local moved tests, plugin SDK boundary tests, extension loader tests, agents-support shard, UI build/test, build artifacts, lint, workflow guards, autoreview, and GitHub CI passed on PR head 963d893715.
19 lines
648 B
TypeScript
19 lines
648 B
TypeScript
import { normalizeTrimmedStringList } from "@openclaw/normalization-core/string-normalization";
|
|
|
|
/**
|
|
* Normalize optional gateway URL-input hostname allowlists.
|
|
*
|
|
* Semantics are intentionally:
|
|
* - missing / empty / whitespace-only list => no hostname allowlist restriction
|
|
* - deny-all URL fetching => use the corresponding `allowUrl: false` switch
|
|
*/
|
|
export function normalizeInputHostnameAllowlist(
|
|
values: string[] | undefined,
|
|
): string[] | undefined {
|
|
if (!values || values.length === 0) {
|
|
return undefined;
|
|
}
|
|
const normalized = normalizeTrimmedStringList(values);
|
|
return normalized.length > 0 ? normalized : undefined;
|
|
}
|