@putout/plugin-apply-at
🐊Putout plugin adds ability apply at()
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-apply-at 
SYNC missed versions from official npm registry.

@putout/plugin-apply-at NPM version

The at() method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array.

(c) Array.prototype.at()

The at() method takes an integer value and returns a new String consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character.>

(c) String.prototype.at()

🐊Putout plugin adds ability to apply array.at().

Install

npm i @putout/plugin-apply-at

Rule

{
    "rules": {
        "apply-at": "on"
    }
}

❌ Example of incorrect code

const latest = (a) => a[a.length - 1];

✅ Example of correct code

const latest = (a) => a.at(-1);

License

MIT

Current Tags

  • 2.0.0                                ...           latest (a year ago)

4 Versions

  • 2.0.0                                ...           a year ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE