MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / boundNumber

Function boundNumber

frontend/util/util.ts:62–67  ·  view source on GitHub ↗
(num: number, min: number, max: number)

Source from the content-addressed store, hash-verified

60}
61
62function boundNumber(num: number, min: number, max: number): number {
63 if (num == null || typeof num != "number" || isNaN(num)) {
64 return null;
65 }
66 return Math.min(Math.max(num, min), max);
67}
68
69// key must be a suitable weakmap key. pass the new value
70// it will return the prevValue (for object equality) if the new value is deep equal to the prev value

Callers 7

ProgressBarFunction · 0.90
MarkdownFunction · 0.90
constructorMethod · 0.90
DiffViewerFunction · 0.90
CodeEditorFunction · 0.90
computeBgStyleFromMetaFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected