@putout/plugin-apply-to-sorted
🐊Putout plugin adds ability to apply 'toSorted()'
Last updated 2 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-apply-to-sorted 
SYNC missed versions from official npm registry.

@putout/plugin-apply-to-sorted NPM version

The toSorted() method of Array instances is the copying version of the sort() method. It returns a new array with the elements sorted in ascending order. (c) MDN

🐊Putout plugin adds ability to apply toSorted.

Checkout in 🐊Putout Editor.

Install

npm i @putout/plugin-apply-to-sorted

Rule

{
    "rules": {
        "apply-to-sorted": "on"
    }
}

❌ Example of incorrect code

[...a].sort((a, b) => a - b);

✅ Example of correct code

a.toSorted((a, b) => a - b);

License

MIT

Current Tags

  • 1.0.1                                ...           latest (2 months ago)

3 Versions

  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.0.0-stage                                ...           2 months ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE