You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
npmnpm
Version published
Weekly downloads
20
33.33%
Maintainers
1
Weekly downloads
 
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

array

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