New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

arr-toolkit

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arr-toolkit

A collection of handy array manipulation functions.

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
1
-66.67%
Maintainers
0
Weekly downloads
 
Created
Source

ci

arr-toolkit

arr-toolkit is a comprehensive utility library for array manipulation, offering a range of functions to streamline common array operations such as finding intersections, calculating differences, shuffling elements, chunking arrays, flattening nested structures, ensuring uniqueness, rotating elements, zipping arrays, partitioning based on conditions, and unifying arrays.

🛠️ Installation

Install arr-toolkit via npm:

npm install arr-toolkit

⭐ Usage

Import the functions you need from arr-toolkit:

NameUsageOutput
Intersectionintersection([1, 2, 3], [2, 3, 4])[2, 3]
Differencedifference([1, 2, 3], [2, 3, 4])[1]
Shuffleshuffle([1, 2, 3, 4, 5])[3, 1, 5, 2, 4] (varies)
Chunkchunk([1, 2, 3, 4, 5], 2)[[1, 2], [3, 4], [5]]
Flattenflatten([1, [2, [3, 4], 5]])[1, 2, 3, 4, 5]
Uniqueunique([1, 2, 2, 3, 4, 4, 5])[1, 2, 3, 4, 5]
Rotaterotate([1, 2, 3, 4, 5], 2)[4, 5, 1, 2, 3]
Zipzip([1, 2, 3], ['a', 'b', 'c'])[[1, 'a'], [2, 'b'], [3, 'c']]
Partitionpartition([1, 2, 3, 4, 5], x => x % 2 === 0)[[2, 4], [1, 3, 5]]
Unionunion([1, 2, 3], [3, 4, 5])[1, 2, 3, 4, 5]

🚀 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

✨ Documentation in VS Code

When using this package in Visual Studio Code, you can get more information about each method by hovering over it.

📃 LICENSE

This package in under MIT License.

Keywords

array

FAQs

Package last updated on 17 Aug 2024

Did you know?

Socket

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