MCPcopy
hub / github.com/bbc/peaks.js / clamp

Function clamp

src/utils.js:78–88  ·  view source on GitHub ↗
(value, min, max)

Source from the content-addressed store, hash-verified

76}
77
78export function clamp(value, min, max) {
79 if (value < min) {
80 return min;
81 }
82 else if (value > max) {
83 return max;
84 }
85 else {
86 return value;
87 }
88}
89
90export function objectHasProperty(object, field) {
91 return Object.prototype.hasOwnProperty.call(object, field);

Callers 11

utils-spec.jsFile · 0.90
SegmentShapeFunction · 0.90
segment-shape.jsFile · 0.90
points-layer.jsFile · 0.90
highlight-layer.jsFile · 0.90
scrollbar.jsFile · 0.90
waveform-shape.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected