diff --git a/index.js b/index.js index 9c48504..5288635 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,12 @@ 'use strict'; const split = require('split-string'); -const flatten = require('arr-flatten'); const union = require('union-value'); const forOwn = require('for-own'); const typeOf = require('kind-of'); const get = require('get-value'); -function groupFn(arr, props) { +function groupFn(arr, ...props) { if (arr == null) { return []; } @@ -20,7 +19,7 @@ function groupFn(arr, props) { return arr; } - let args = flatten([].slice.call(arguments, 1)); + let args = props.flat(Infinity); let groups = groupBy(arr, args[0]); for (let i = 1; i < args.length; i++) { diff --git a/package.json b/package.json index e33c1df..57c63cb 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,12 @@ ], "main": "index.js", "engines": { - "node": ">=8" + "node": ">=11.0.0" }, "scripts": { "test": "mocha" }, "dependencies": { - "arr-flatten": "^1.1.0", "for-own": "^1.0.0", "get-value": "^3.0.1", "kind-of": "^6.0.2",