added batching for postgres

This commit is contained in:
dswbx
2025-03-07 19:40:58 +01:00
parent 3704cad53a
commit a4cb012ce8
7 changed files with 53 additions and 5 deletions

View File

@@ -3,3 +3,11 @@ export function clampNumber(value: number, min: number, max: number): number {
const upper = Math.max(min, max);
return Math.max(lower, Math.min(value, upper));
}
export function ensureInt(value?: string | number | null | undefined): number {
if (value === undefined || value === null) {
return 0;
}
return typeof value === "number" ? value : Number.parseInt(value, 10);
}