Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@putout/plugin-remove-useless-spread
Advanced tools
Readme
Spread syntax can be used when all elements from an object or array need to be included in a list of some kind.
(c) MDN
🐊Putout plugin adds ability to remove useless spread syntax.
npm i @putout/plugin-remove-useless-spread
{
"rules": {
"remove-useless-spread/array": "on",
"remove-useless-spread/object": "on",
"remove-useless-spread/nested": "on"
}
}
The thing is [...b]
can be used for:
string
to an array
.So better to be more concrete and use slice
for copying and Array()
/Array.from()
for converting to decrease cognitive load.
Also sometimes there is no need on any of this operations, and we can drop spread
.
for (const a of [...b]) {}
const places = [...getPlaces()];
for (const a of b) {}
const places = getPlaces();
// Array constructor creates sparse array
[...Array(5)].map(Number);
const a = {
...fn(),
};
const a = fn();
Checkout in 🐊Putout Editor.
[
...[
...a,
...b,
],
...x,
];
[
...a,
...b,
...x,
];
MIT
FAQs
🐊Putout plugin adds ability to remove useless spread
The npm package @putout/plugin-remove-useless-spread receives a total of 15,980 weekly downloads. As such, @putout/plugin-remove-useless-spread popularity was classified as popular.
We found that @putout/plugin-remove-useless-spread demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.