Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
alert => alert.highlightBegin <= offset && offset <= alert.highlightEnd
)
if (!alerts.length) return
alerts.sort((a, b) => a.highlightEnd - a.highlightBegin - (b.highlightEnd - b.highlightBegin))
const alert = alerts[0]
const hover: Hover = {
range: getRangeInDocument(document, alert.highlightBegin, alert.highlightEnd),
contents: {
kind: 'markdown',
value:
alert.explanation || alert.details || alert.examples
? toMarkdown(`${alert.explanation || ''} ${alert.details || ''} ${alert.examples || ''}`)
: '',
},
}
return hover
})
)