aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/esnext.math.clamp.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/modules/esnext.math.clamp.js')
-rw-r--r--node_modules/core-js/modules/esnext.math.clamp.js12
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));
+ }
+});