Wondering what’s next for npm?Check out our public roadmap! »

subsets

1.0.0 • Public • Published

subsets

groupBy with comparison function.

Usage

var subsets = require('subsets');
 
var checks = 0;
 
var sets = subsets([ 1, 10, 4, 25, 26, 6 ], function(a, b) {
  checks++;
  return Math.abs(- b) <= 3;
});
 
console.log(sets);
// [[1, 4, 6], [10], [25, 26]]
 
console.log(checks);
// 12

License

MIT

Install

npm i subsets

DownloadsWeekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar