diff options
Diffstat (limited to 'node_modules/core-js/modules/esnext.math.clamp.js')
| -rw-r--r-- | node_modules/core-js/modules/esnext.math.clamp.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/core-js/modules/esnext.math.clamp.js b/node_modules/core-js/modules/esnext.math.clamp.js new file mode 100644 index 0000000..c69b122 --- /dev/null +++ b/node_modules/core-js/modules/esnext.math.clamp.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var min = Math.min; +var max = Math.max; + +// `Math.clamp` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + clamp: function clamp(x, lower, upper) { + return min(upper, max(lower, x)); + } +}); |
