MCPcopy Create free account
hub / github.com/formbricks/formbricks / toPositiveInt

Function toPositiveInt

packages/database/src/prisma-adapter.ts:25–32  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

23
24// Strictly positive — for params where 0 makes no sense (e.g. connection pool size).
25const toPositiveInt = (value: string | null): number | undefined => {
26 if (value === null || value.trim() === "") {
27 return undefined;
28 }
29
30 const parsed = Number.parseInt(value, 10);
31 return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
32};
33
34// Non-negative — for params where 0 has the documented meaning of "disable /
35// unlimited" (e.g. connect_timeout=0 means wait indefinitely, idle lifetime=0

Callers 1

createPrismaPgAdapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected