mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-20 17:41:33 -06:00
00d8d7ead0
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.
21 lines
590 B
TypeScript
21 lines
590 B
TypeScript
import { normalizeOptionalLowercaseString } from "../../packages/normalization-core/src/string-coerce.js";
|
|
|
|
/** Read loose boolean params from tool input that may arrive as booleans or "true"/"false" strings. */
|
|
export function readBooleanParam(
|
|
params: Record<string, unknown>,
|
|
key: string,
|
|
): boolean | undefined {
|
|
const raw = params[key];
|
|
if (typeof raw === "boolean") {
|
|
return raw;
|
|
}
|
|
const normalized = normalizeOptionalLowercaseString(raw);
|
|
if (normalized === "true") {
|
|
return true;
|
|
}
|
|
if (normalized === "false") {
|
|
return false;
|
|
}
|
|
return undefined;
|
|
}
|