UNPKG

fixed-data-table

Version:

A React table component designed to allow presenting thousands of rows of data.

32 lines (29 loc) 687 B
/** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule clamp * @typechecks */ /** * Clamps (or clips or confines) the value to be between min and max. * @param {number} value * @param {number} min * @param {number} max * @return {number} */ "use strict"; function clamp(value, min, max) { if (value < min) { return min; } if (value > max) { return max; } return value; } module.exports = clamp;