Skip to content

Commit

Permalink
refactor (annotations/report): better json format
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Jan 11, 2024
1 parent 60cf63e commit 81fba89
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 81fba89

Please sign in to comment.