@putout/plugin-convert-array-copy-to-slice
🐊Putout plugin adds ability to convert array copy to slice
Last updated 4 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-array-copy-to-slice 
SYNC missed versions from official npm registry.

@putout/plugin-convert-array-copy-to-slice NPM version

Spread syntax (...) allows an array expression to be expanded in places where elements are expected.

The slice() method returns a shallow copy of a portion of an array into a new array.

(c) MDN

🐊Putout plugin convert spread to slice(). Not bundled.

Install

npm i @putout/plugin-convert-array-copy-to-slice -D

Rule

{
    "rules": {
        "convert-array-copy-to-slice": "on"
    }
}

❌ Example of incorrect code

const places = [...items];

✅ Example of correct code

const places = items.slice();

License

MIT

Current Tags

  • 5.0.1                                ...           latest (4 months ago)

13 Versions

  • 5.0.1                                ...           4 months ago
  • 5.0.0                                ...           9 months ago
  • 4.0.1                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           5 years ago
  • 1.4.0                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 22
Today 0
This Week 0
This Month 20
Last Day 0
Last Week 7
Last Month 2
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

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