Socket
Socket
Sign inDemoInstall

@putout/plugin-apply-at

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @putout/plugin-apply-at

🐊Putout plugin adds ability apply at()


Version published
Weekly downloads
3.4K
increased by8.07%
Maintainers
1
Install size
4.21 kB
Created
Weekly downloads
 

Readme

Source

@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

Keywords

FAQs

Last updated on 14 Sep 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc