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

Function clamp

src/material/progress-bar/progress-bar.ts:254–256  ·  view source on GitHub ↗

Clamps a value to be between two numbers, by default 0 and 100.

(v: number, min = 0, max = 100)

Source from the content-addressed store, hash-verified

252
253/** Clamps a value to be between two numbers, by default 0 and 100. */
254function clamp(v: number, min = 0, max = 100) {
255 return Math.max(min, Math.min(max, v));
256}

Callers 2

valueMethod · 0.70
bufferValueMethod · 0.70

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected