MCPcopy Create free account
hub / github.com/angular/components / clamp

Function clamp

src/cdk/drag-drop/drag-ref.ts:1666–1668  ·  view source on GitHub ↗

Clamps a value between a minimum and a maximum.

(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

1664
1665/** Clamps a value between a minimum and a maximum. */
1666function clamp(value: number, min: number, max: number) {
1667 return Math.max(min, Math.min(max, value));
1668}
1669
1670/** Determines whether an event is a touch event. */
1671function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {

Callers 1

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected