MCPcopy Create free account
hub / github.com/ACM-VIT/conclave / parsePositiveInt

Function parsePositiveInt

apps/web/transcript-worker/src/utils.ts:26–32  ·  view source on GitHub ↗
(
  value: string | undefined,
  fallback: number,
)

Source from the content-addressed store, hash-verified

24 return match ? decodeURIComponent(match[1] || "") : null;
25};
26
27export const parsePositiveInt = (
28 value: string | undefined,
29 fallback: number,
30): number => {
31 const parsed = Number(value);
32 return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
33};
34
35export const safeJsonParse = (value: string): unknown => {

Callers 2

trimSegmentsMethod · 0.90
armCleanupAlarmMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected