New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arr-group

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arr-group

Helper function to group array elements by a criteria callback function.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arr-group

Helper function to group array elements by a criteria callback function.

Usage

npm install arr-group

The passed array has to be sorted reflecting the order the single items has to be checked for. See code of group-numbers about how arr-group is used.

Arguments

arr

The array to be grouped. It has to be sorted reflecting the order the single has to be checked for.

isNextFunction

Callback that should return true if the passed current element is following the passed previous element.

function(currentItem, previousItem) {
  [...]
  return true;  // current item is the following the previous item
  [...]
  return false; // current item is not following the previous item
}

returnSingleElements

Whether to return single elements in the array as single elements or in an array (of a single element). Defaults to true.

Keywords

FAQs

Package last updated on 26 Oct 2015

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc