nested-groupby
Advanced tools
Comparing version 1.0.4 to 2.0.0
@@ -5,12 +5,14 @@ import groupBy from 'lodash.groupby'; | ||
function nestedGroupBy(seq, keys) { | ||
if (!keys.length) { | ||
return seq; | ||
} | ||
const first = keys[0]; | ||
const rest = keys.slice(1); | ||
return mapValues(groupBy(seq, first), function (value) { | ||
return nestedGroupBy(value, rest); | ||
}); | ||
if (!keys.length) { | ||
return seq; | ||
} | ||
var first = keys[0]; | ||
var rest = keys.slice(1); | ||
return mapValues(groupBy(seq, first), function (value) { | ||
return nestedGroupBy(value, rest); | ||
}); | ||
} | ||
export default nestedGroupBy; | ||
//# sourceMappingURL=nested-groupby.esm.js.map |
{ | ||
"name": "nested-groupby", | ||
"version": "1.0.4", | ||
"main": "dist/nested-groupby.cjs.js", | ||
"module": "dist/nested-groupby.esm.js", | ||
"browser": "dist/nested-groupby.umd.js", | ||
"author": "Marcus T. Hellams", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"description": "A multi-level groupBy for arrays. Nesting allows elements in an array to be grouped into a hierarchical tree structure; think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table. The levels in the tree are specified by key functions.", | ||
"dependencies": { | ||
"lodash.groupby": "^4.6.0", | ||
"lodash.mapvalues": "^4.6.0" | ||
}, | ||
"repository": "https://github.com/MarcusTHellams/nested-groupby", | ||
"homepage": "https://github.com/MarcusTHellams/nested-groupby", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^11.0.1", | ||
"@rollup/plugin-node-resolve": "^7.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^1.29.0" | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"clean": "node scripts/removeDist.js", | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "node test/test.js", | ||
"pretest": "npm run build", | ||
"build:remove": "run-s clean build", | ||
"prepublish": "npm run build:remove" | ||
"start": "tsdx watch", | ||
"go": "node dist/index.js", | ||
"build": "tsdx build", | ||
"test": "tsdx test", | ||
"lint": "tsdx lint", | ||
"prepare": "tsdx build", | ||
"size": "size-limit", | ||
"analyze": "size-limit --why" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
"peerDependencies": {}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint" | ||
} | ||
}, | ||
"prettier": { | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
}, | ||
"name": "nested-groupby", | ||
"author": "Marcus T. Hellams", | ||
"module": "dist/nested-groupby.esm.js", | ||
"size-limit": [ | ||
{ | ||
"path": "dist/nested-groupby.cjs.production.min.js", | ||
"limit": "10 KB" | ||
}, | ||
{ | ||
"path": "dist/nested-groupby.esm.js", | ||
"limit": "10 KB" | ||
} | ||
], | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "^5.0.1", | ||
"@types/lodash.groupby": "^4.6.6", | ||
"@types/lodash.mapvalues": "^4.6.6", | ||
"@types/node": "^16.3.2", | ||
"husky": "^7.0.1", | ||
"size-limit": "^5.0.1", | ||
"ts-node": "^10.1.0", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.3.0", | ||
"typescript": "^4.3.5" | ||
}, | ||
"dependencies": { | ||
"lodash.groupby": "^4.6.0", | ||
"lodash.mapvalues": "^4.6.0" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
12
1
9132
10
56
1
2
1