@putout/plugin-convert-object-entries-to-object-keys
🐊Putout plugin adds ability to convert 'Object.entries()' to 'Object.keys()'
Last updated 7 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-object-entries-to-object-keys 
SYNC missed versions from official npm registry.

@putout/plugin-convert-object-entries-to-object-keys NPM version

The Object.keys() static method returns an array of a given object's own enumerable string-keyed property key-value pairs.

(c) Object.keys()

The Object.entries() static method returns an array of a given object's own enumerable string-keyed property key-value pairs.

(c) Object.entries()

????Putout plugin adds ability to convert Object.entries() to Object.keys()

Install

npm i @putout/plugin-convert-object-entries-to-object-keys -D

Checkout in ????Putout Editor.

Rule

{
    "rules": {
        "convert-object-entries-to-object-keys": "on"
    }
}

❌ Example of incorrect code

for (const [name] of Object.entries(tokens)) {
    console.log(name);
}

for (const [name] of entries(tokens)) {
    console.log(name);
}

✅ Example of correct code

for (const name of Object.keys(tokens)) {
    console.log(name);
}

for (const name of keys(tokens)) {
    console.log(name);
}

License

MIT

Current Tags

  • 1.0.2                                ...           latest (7 months ago)

3 Versions

  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |