MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / ensurePositiveInteger

Function ensurePositiveInteger

vector/utils.js:66–71  ·  view source on GitHub ↗
(value, fallback)

Source from the content-addressed store, hash-verified

64}
65
66export function ensurePositiveInteger(value, fallback) {
67 if (!Number.isFinite(value)) return fallback;
68 const coerced = Math.floor(value);
69 if (coerced <= 0) return fallback;
70 return coerced;
71}

Callers 3

searchMethod · 0.90
constructorMethod · 0.90
searchMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected