MCPcopy
hub / github.com/react-grid-layout/react-grid-layout / clamp

Function clamp

src/core/calculate.ts:310–316  ·  view source on GitHub ↗
(
  num: number,
  lowerBound: number,
  upperBound: number
)

Source from the content-addressed store, hash-verified

308 * @returns Clamped value
309 */
310export function clamp(
311 num: number,
312 lowerBound: number,
313 upperBound: number
314): number {
315 return Math.max(Math.min(num, upperBound), lowerBound);
316}
317
318// ============================================================================
319// Grid Background Calculations

Callers 4

calcXYFunction · 0.70
calcWHFunction · 0.70
GridItemFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…