
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
@putout/plugin-convert-object-entries-to-array-entries
Advanced tools
🐊Putout plugin adds ability to convert 'const' to 'let'
The
Object.entries()
static method returns an array of a given object's own enumerable string-keyed property key-value pairs.(c)
Object.entries()
The
entries()
method returns a newArray Iterator
object that contains the key/value pairs for each index in the array.
🐊Putout plugin adds ability to convert Object.entries()
to Array.prototype.entries()
to avoid bugs
related to using index
in unary (!index
) or binary (index > length
) expressions, the thing is Object.entries()
returns list of Array<String, any>
tuples,
and Array.prototype.entries()
returns list of Array<Number, any>
tuples it can lead to bugs when you expected that index
is number.
Check out in 🐊Putout Editor.
npm i @putout/plugin-convert-object-entries-to-array-entries -D
{
"rules": {
"convert-object-entries-to-array-entries": "on"
}
}
const {entries} = Object;
for (const [i, token] of entries(tokens)) {
if (!i)
continue;
fn(token);
}
for (const [i, token] of tokens.entries()) {
if (!i)
continue;
fn(token);
}
MIT
FAQs
🐊Putout plugin adds ability to convert 'const' to 'let'
We found that @putout/plugin-convert-object-entries-to-array-entries 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
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.