mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 23:04:05 +00:00
9 lines
281 B
TypeScript
9 lines
281 B
TypeScript
export function resolveWebhookIntegerOption(
|
|
value: number | undefined,
|
|
fallback: number,
|
|
params: { min: number },
|
|
): number {
|
|
const candidate = typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
return Math.max(params.min, Math.floor(candidate));
|
|
}
|