@putout/plugin-convert-sqrt-to-hypot
🐊Putout plugin adds ability to convert 'Math.sqrt()' to 'Math.hypot()'
Last updated 4 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-sqrt-to-hypot 
SYNC missed versions from official npm registry.

@putout/plugin-convert-sqrt-to-hypot NPM version

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.

Install

npm i @putout/plugin-convert-sqrt-to-hypot -D

Rule

Rule convert-sqrt-to-hypot is enabled by default, to disable add to .putout.json:

{
    "rules": {
        "convert-sqrt-to-hypot": "off"
    }
}

❌ Example of incorrect code

Math.sqrt(a ** 2, b ** 2);

✅ Example of correct code

Math.hypot(a, b);

License

MIT

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |