let - const
This commit is contained in:
parent
0d21a7be8d
commit
2ea0f80a2d
|
@ -66,11 +66,11 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
updateStyle(style, oldCluster, newCluster) {
|
updateStyle(style, oldCluster, newCluster) {
|
||||||
let colorOverrides = [] // only capture color overides
|
const colorOverrides = [] // only capture color overides
|
||||||
oldCluster.forEach((color, index) => {
|
oldCluster.forEach((color, index) => {
|
||||||
let value = newCluster[index]
|
const value = newCluster[index]
|
||||||
let repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi')
|
const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi')
|
||||||
let nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color'
|
const nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color'
|
||||||
let v
|
let v
|
||||||
while ((v = repl.exec(style))) {
|
while ((v = repl.exec(style))) {
|
||||||
colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary
|
colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary
|
||||||
|
|
Loading…
Reference in New Issue