UNPKG

408 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.clamp = clamp;
7
8/*
9Copyright (c) 2018-2020 Uber Technologies, Inc.
10
11This source code is licensed under the MIT license found in the
12LICENSE file in the root directory of this source tree.
13*/
14// Clamp a number between a min and max
15function clamp(num, minNum, maxNum) {
16 return Math.min(Math.max(num, minNum), maxNum);
17}
\No newline at end of file