18 lines
416 B
JavaScript
18 lines
416 B
JavaScript
|
|
||
|
/* -------------------------------------------- */
|
||
|
export class RdDItem {
|
||
|
|
||
|
/* -------------------------------------------- */
|
||
|
static buildItemsClassification( items ) {
|
||
|
let itemsByType = {};
|
||
|
for (const item of items) {
|
||
|
let list = itemsByType[item.type];
|
||
|
if (!list) {
|
||
|
list = [];
|
||
|
itemsByType[item.type] = list;
|
||
|
}
|
||
|
list.push(item);
|
||
|
}
|
||
|
return itemsByType;
|
||
|
}
|
||
|
}
|