mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
added batching for postgres
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user