forked from waja/action-debian-package
update
This commit is contained in:
parent
d9becc67b6
commit
9308795b8b
964 changed files with 104265 additions and 16 deletions
36
node_modules/ramda/src/clamp.js
generated
vendored
Normal file
36
node_modules/ramda/src/clamp.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
var _curry3 =
|
||||
/*#__PURE__*/
|
||||
require("./internal/_curry3");
|
||||
/**
|
||||
* Restricts a number to be within a range.
|
||||
*
|
||||
* Also works for other ordered types such as Strings and Dates.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.20.0
|
||||
* @category Relation
|
||||
* @sig Ord a => a -> a -> a -> a
|
||||
* @param {Number} minimum The lower limit of the clamp (inclusive)
|
||||
* @param {Number} maximum The upper limit of the clamp (inclusive)
|
||||
* @param {Number} value Value to be clamped
|
||||
* @return {Number} Returns `minimum` when `val < minimum`, `maximum` when `val > maximum`, returns `val` otherwise
|
||||
* @example
|
||||
*
|
||||
* R.clamp(1, 10, -5) // => 1
|
||||
* R.clamp(1, 10, 15) // => 10
|
||||
* R.clamp(1, 10, 4) // => 4
|
||||
*/
|
||||
|
||||
|
||||
var clamp =
|
||||
/*#__PURE__*/
|
||||
_curry3(function clamp(min, max, value) {
|
||||
if (min > max) {
|
||||
throw new Error('min must not be greater than max in clamp(min, max, value)');
|
||||
}
|
||||
|
||||
return value < min ? min : value > max ? max : value;
|
||||
});
|
||||
|
||||
module.exports = clamp;
|
Loading…
Add table
Add a link
Reference in a new issue