MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / clamp

Function clamp

graph-ui/src/traces/bug-paths.ts:183–188  ·  view source on GitHub ↗

A bound brought inside the range this reading will honour.

(value: number | undefined, fallback: number, maximum: number)

Source from the content-addressed store, hash-verified

181
182/** A bound brought inside the range this reading will honour. */
183function clamp(value: number | undefined, fallback: number, maximum: number): number {
184 if (value === undefined || !Number.isFinite(value)) {
185 return fallback;
186 }
187 return Math.min(maximum, Math.max(1, Math.floor(value)));
188}
189
190/**
191 * How one symbol is identified across the two readings.

Callers 1

bugPathsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected