Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groupBy multiple key #177

Open
sckoh opened this issue Dec 21, 2015 · 1 comment
Open

groupBy multiple key #177

sckoh opened this issue Dec 21, 2015 · 1 comment

Comments

@sckoh
Copy link

sckoh commented Dec 21, 2015

it('should allow groupBy multiple key', function() {
  var arrays = [
    { key1: 1, key2: 1, data: {} },
    { key1: 1, key2: 1, data: {} },
    { key1: 1, key2: 2, data: {} },
    { key1: 1, key2: 2, data: {} },
    { key1: 2, key2: 3, data: {} },
    { key1: 2, key2: 3, data: {} },
    { key1: 2, key2: 4, data: {} },
    { key1: 2, key2: 4, data: {} }
  ];

  expect(filter(arrays, ['key1', 'key2'])).toEqual({
    '1,1': [arrays[0], arrays[1]],
    '1,2': [arrays[2], arrays[3]],
    '2,3': [arrays[4], arrays[5]],
    '2,4': [arrays[6], arrays[7]]
  });
});

should allow to group by multiple key instead of only 1 key

@poloagustin
Copy link

Great addition. Please include this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants