MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / clampQuery

Function clampQuery

src/webui/workspaces-ws.ts:218–225  ·  view source on GitHub ↗
(raw: string | null, fallback: number, lo: number, hi: number)

Source from the content-addressed store, hash-verified

216}
217
218function clampQuery(raw: string | null, fallback: number, lo: number, hi: number): number {
219 if (raw === null) return fallback;
220 const n = Number.parseInt(raw, 10);
221 if (!Number.isFinite(n)) return fallback;
222 if (n < lo) return lo;
223 if (n > hi) return hi;
224 return n;
225}
226
227function parseSince(raw: string): number | undefined {
228 const n = Number.parseInt(raw, 10);

Callers 1

attachWorkspacesWSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected