refactoring

This commit is contained in:
Philipp Kühn 2021-02-06 12:54:48 +01:00
parent 888e7a518e
commit 05be43ac54

View File

@ -15,15 +15,17 @@ export default function (doc: Node): DecorationSet {
return
}
[...node.text.matchAll(hexColor)].forEach(match => {
const index = match.index || 0
Array
.from(node.text.matchAll(hexColor))
.forEach(match => {
const index = match.index || 0
results.push({
color: match[0],
from: position + index,
to: position + index + match[0].length,
results.push({
color: match[0],
from: position + index,
to: position + index + match[0].length,
})
})
})
})
results.forEach(issue => {