MCPcopy
hub / github.com/tomkp/react-split-pane / clamp

Function clamp

src/utils/calculations.ts:31–33  ·  view source on GitHub ↗
(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

29 * Constrain a value between min and max
30 */
31export function clamp(value: number, min: number, max: number): number {
32 return Math.min(Math.max(value, min), max);
33}
34
35/**
36 * Snap a value to the nearest snap point if within tolerance

Callers 3

useKeyboardResizeFunction · 0.90
calculateDraggedSizesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…