$ cnpm install @putout/plugin-convert-sqrt-to-hypot
The
Math.hypot()function returns the square root of the sum of squares of its arguments.(c) MDN
????Putout plugin adds ability to convert Math.sqrt() to Math.hypot().
Check out in ????Putout Editor.
npm i @putout/plugin-convert-sqrt-to-hypot -D
Rule convert-sqrt-to-hypot is enabled by default, to disable add to .putout.json:
{
"rules": {
"convert-sqrt-to-hypot": "off"
}
}
Math.sqrt(a ** 2, b ** 2);
Math.hypot(a, b);
MIT
Copyright 2013 - present © cnpmjs.org | Home |