Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/services/Summary/summary-processing.js
  • Loading branch information
JiahuiChen99 committed Dec 12, 2021
2 parents 890618c + ef24523 commit 2400a1e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/services/Summary/summary-processing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function summary_processing(logs) {
let type = {};
logs.forEach( (log) => {
// Process all types of logs and count each one of them
if ( type[log.type] !== undefined ) {
type[log.type].count +=1;
type[log.type].interactions[log.interaction] = (type[log.type].interactions[log.interaction] + 1) || 1;
} else {
type[log.type] = {
count: 1,
interactions: {}
}
type[log.type].interactions[log.interaction] = 1;
}
})

return type;
}

export { summary_processing };

0 comments on commit 2400a1e

Please sign in to comment.