diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/es5-ext/math/hypot | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
Diffstat (limited to 'node_modules/es5-ext/math/hypot')
-rw-r--r-- | node_modules/es5-ext/math/hypot/implement.js | 8 | ||||
-rw-r--r-- | node_modules/es5-ext/math/hypot/index.js | 5 | ||||
-rw-r--r-- | node_modules/es5-ext/math/hypot/is-implemented.js | 7 | ||||
-rw-r--r-- | node_modules/es5-ext/math/hypot/shim.js | 43 |
4 files changed, 0 insertions, 63 deletions
diff --git a/node_modules/es5-ext/math/hypot/implement.js b/node_modules/es5-ext/math/hypot/implement.js deleted file mode 100644 index e2b3928b3..000000000 --- a/node_modules/es5-ext/math/hypot/implement.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -if (!require("./is-implemented")()) { - Object.defineProperty(Math, "hypot", { value: require("./shim"), - configurable: true, -enumerable: false, -writable: true }); -} diff --git a/node_modules/es5-ext/math/hypot/index.js b/node_modules/es5-ext/math/hypot/index.js deleted file mode 100644 index a030a4198..000000000 --- a/node_modules/es5-ext/math/hypot/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -module.exports = require("./is-implemented")() - ? Math.hypot - : require("./shim"); diff --git a/node_modules/es5-ext/math/hypot/is-implemented.js b/node_modules/es5-ext/math/hypot/is-implemented.js deleted file mode 100644 index d317bc7e5..000000000 --- a/node_modules/es5-ext/math/hypot/is-implemented.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = function () { - var hypot = Math.hypot; - if (typeof hypot !== "function") return false; - return hypot(3, 4) === 5; -}; diff --git a/node_modules/es5-ext/math/hypot/shim.js b/node_modules/es5-ext/math/hypot/shim.js deleted file mode 100644 index 2a92b1715..000000000 --- a/node_modules/es5-ext/math/hypot/shim.js +++ /dev/null @@ -1,43 +0,0 @@ -// Thanks for hints: https://github.com/paulmillr/es6-shim - -"use strict"; - -var some = Array.prototype.some - , abs = Math.abs - , sqrt = Math.sqrt - , compare = function (val1, val2) { - return val2 - val1; -} - , divide = function (value) { - return value / this; -} - , add = function (sum, number) { - return sum + number * number; -}; - -// eslint-disable-next-line no-unused-vars -module.exports = function (val1, val2 /*, …valn*/) { - var result, numbers; - if (!arguments.length) return 0; - some.call(arguments, function (val) { - if (isNaN(val)) { - result = NaN; - return false; - } - if (!isFinite(val)) { - result = Infinity; - return true; - } - if (result !== undefined) return false; - val = Number(val); - if (val === 0) return false; - if (numbers) numbers.push(abs(val)); - else numbers = [abs(val)]; - return false; - }); - if (result !== undefined) return result; - if (!numbers) return 0; - - numbers.sort(compare); - return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0)); -}; |