X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Finternals%2Fmath-scale.js;h=ceb3c21c8cfaef404955482671c9573e4a83a4e4;hp=c1a76eb4bc28bf441261baa29a436c3c1238f641;hb=3be0a9efc698a9570a44456009afc6014812625a;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088 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 index c1a76eb4..ceb3c21c 100644 --- 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 @@ -1,16 +1,13 @@ // `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; + var nx = +x; + var nInLow = +inLow; + var nInHigh = +inHigh; + var nOutLow = +outLow; + var nOutHigh = +outHigh; + // eslint-disable-next-line no-self-compare -- NaN check + if (nx != nx || nInLow != nInLow || nInHigh != nInHigh || nOutLow != nOutLow || nOutHigh != nOutHigh) return NaN; + if (nx === Infinity || nx === -Infinity) return nx; + return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow; };