.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / math-scale.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/math-scale.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/math-scale.js
new file mode 100644 (file)
index 0000000..c1a76eb
--- /dev/null
@@ -0,0 +1,16 @@
+// `Math.scale` method implementation
+// https://rwaldron.github.io/proposal-math-extensions/
+module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
+  if (
+    arguments.length === 0
+      /* eslint-disable no-self-compare -- NaN check */
+      || x != x
+      || inLow != inLow
+      || inHigh != inHigh
+      || outLow != outLow
+      || outHigh != outHigh
+      /* eslint-enable no-self-compare -- NaN check */
+  ) return NaN;
+  if (x === Infinity || x === -Infinity) return x;
+  return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
+};