Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/obj-group
module for helping to group array item into an object with a key that self-determined
https://github.com/michaelwp/obj-group
Last synced: 6 days ago
JSON representation
module for helping to group array item into an object with a key that self-determined
- Host: GitHub
- URL: https://github.com/michaelwp/obj-group
- Owner: michaelwp
- Created: 2019-10-20T12:29:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-26T12:42:45.000Z (over 4 years ago)
- Last Synced: 2024-04-25T20:03:12.666Z (10 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/obj-group
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README-BR.md
Awesome Lists containing this project
README
# obj-group
módulo para ajudar a agrupar item de matriz em um objeto com uma chaveque é pré-determinada## Historico de Versões
* ##### v1.0.0 - A Primerissima versão
```
Hello World :)
```
* ##### v1.0.1 - A ultima versão
```
- handling input data
- add handling error messages
```## Como Utilizar
``` npm i obj-group --save ```
```javascript
//
const objGroup = require('obj-group');//inserir dados na matriz de dados :
const value = [
['sniper', 'agility', "ranged"],
['axe', 'strength', 'melee'],
['tusk', 'strength', 'melee'],
['crystal maiden', 'intelligence', 'ranged'],
['phantom assasin', 'agility', 'melee'],
['windrunner', 'intelligence', 'ranged']];const actualRes = objGroup(value, 1);
console.log(actualRes);```
### Resultado :
```
{
strength: [['axe', 'melee'], ['tusk', 'melee']],
agility: [['sniper', 'ranged'], ['phantom assasin', 'melee']],
intelligence: [['crystal maiden', 'ranged'], ['windrunner', 'ranged']]
}
```