You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
var isUndef = require('./isUndef'); |
|
exports = function(n, lower, upper) { |
|
if (isUndef(upper)) { |
|
upper = lower; |
|
lower = undefined; |
|
} |
|
if (!isUndef(lower) && n < lower) return lower; |
|
if (n > upper) return upper; |
|
return n; |
|
}; |
|
|
|
module.exports = exports;
|
|
|