refactor(numbers): share non-negative finite guard

This commit is contained in:
Vincent Koc
2026-06-23 03:45:36 +08:00
parent 013e33c6d3
commit 0a338147a5
5 changed files with 8 additions and 16 deletions

View File

@@ -1,2 +1,6 @@
/** Shared numeric coercion facade for legacy imports inside core. */
export * from "@openclaw/normalization-core/number-coercion";
export function resolveNonNegativeNumber(value: number | null | undefined): number | undefined {
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : undefined;
}