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

@putout/plugin-remove-useless-object-from-entries NPM version

The Object.fromEntries() static method transforms a list of key-value pairs into an object.

(c) MDN

????Putout plugin adds ability to remove useless Object.fromEntries().

Install

npm i @putout/plugin-remove-useless-object-from-entries

Rule

{
    "rules": {
        "remove-useless-object-from-entries": "on"
    }
}

❌ Example of incorrect code

const a = {
    b: Object.fromEntries(Object.entries({
        hello: 'world',
    })),
};

✅ Example of correct code

const a = {
    b: {
        hello: 'world',
    },
};

License

MIT

Current Tags

  • 1.0.1                                ...           latest (2 months ago)

2 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |