3.0.0 β€’ Published 11 months ago

@putout/plugin-convert-array-copy-to-slice v3.0.0

Weekly downloads
2,099
License
MIT
Repository
github
Last release
11 months ago

@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().

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

3.0.0

11 months ago

2.0.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago