Skip to content

Commit 2400a1e

Browse files
committed
Merge branch 'dev'
# Conflicts: # src/services/Summary/summary-processing.js
2 parents 890618c + ef24523 commit 2400a1e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function summary_processing(logs) {
2+
let type = {};
3+
logs.forEach( (log) => {
4+
// Process all types of logs and count each one of them
5+
if ( type[log.type] !== undefined ) {
6+
type[log.type].count +=1;
7+
type[log.type].interactions[log.interaction] = (type[log.type].interactions[log.interaction] + 1) || 1;
8+
} else {
9+
type[log.type] = {
10+
count: 1,
11+
interactions: {}
12+
}
13+
type[log.type].interactions[log.interaction] = 1;
14+
}
15+
})
16+
17+
return type;
18+
}
19+
20+
export { summary_processing };

0 commit comments

Comments
 (0)