diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-09 23:17:50 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-09 23:17:50 -0400 |
commit | a1e08c0be1a1067232ea71ed3344ce44d9522bf7 (patch) | |
tree | bc4e7f2761cf02d5728904a46c3bbf27fe7e95c4 /src/client/util/clamp.js | |
parent | a8be7ef95403a1f4559aeff9695e67ad2030e3b9 (diff) |
added center alignment for text using ^^
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 |