diff options
author | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-05 19:17:11 -0400 |
---|---|---|
committer | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-05 19:17:11 -0400 |
commit | 57b57b2d82b385ec9aa9d59c0899dc8f48a31223 (patch) | |
tree | ea9fef42849fc1341c6da1300bc4e5f25048cb14 /src/client/util/clamp.js | |
parent | a44e12f4625caca5d75a456f0ba1ab977149ae6e (diff) | |
parent | 961cb1566e16edb353975ec436a4445c1cf3db0f (diff) |
meged
Diffstat (limited to 'src/client/util/clamp.js')
-rw-r--r-- | src/client/util/clamp.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/util/clamp.js b/src/client/util/clamp.js new file mode 100644 index 000000000..9c7fd78a4 --- /dev/null +++ b/src/client/util/clamp.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = clamp; +function clamp(min, val, max) { + if (val < min) { + return min; + } + if (val > max) { + return max; + } + return val; +}
\ No newline at end of file |