Skip to content

Commit

Permalink
Merge pull request #471 from harena-lab/development
Browse files Browse the repository at this point in the history
refactor (annotations/report): better json format
  • Loading branch information
santanche authored Jan 11, 2024
2 parents ceb7b87 + 81fba89 commit 2afe308
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/adonisjs/public/report/js/report-annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,16 @@ class ReportManager {
const annComp = []

for (const an of annotations) {
for (let f = 0; f < an.fragments.length; f++) {
annComp.push([
an.fragments[f].fragment,
an.fragments[f].start,
an.fragments[f].start + an.fragments[f].size - 1,
(an.fragments.length == 1) ? 'U' : ((f == 0) ? 'B' : ((f+1 < an.fragments.length) ? 'I' : 'L')),
an.categories
])
}
let frag = ''
for (let f = 0; f < an.fragments.length; f++)
frag += (f > 0 ? ' + ' : '') + an.fragments[f].fragment
const last = an.fragments.length - 1
annComp.push([
frag,
an.fragments[0].start,
an.fragments[last].start + an.fragments[last].size - 1,
an.categories
])
}

return {
Expand Down

0 comments on commit 2afe308

Please sign in to comment.