Skip to content

Commit c6cc354

Browse files
twou12031travilyu
authored andcommitted
[enhance] change let to const when can use const
**Phenomenon and reproduction steps** none **Root cause and solution** none **Impactions** none **Test method** none **Affected branch(es)** - main **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo)
1 parent 69465e8 commit c6cc354

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

deepflow-apptracing-panel/src/components/AskGPT.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ export const AskGPT: React.FC<Props> = ({ data }) => {
138138
if (answerIsEnd) {
139139
return htmlText
140140
}
141-
let parser = new DOMParser()
142-
let doc = parser.parseFromString(htmlText, 'text/html')
143-
let target = findLastVisibleTextNode(doc) as any
141+
const parser = new DOMParser()
142+
const doc = parser.parseFromString(htmlText, 'text/html')
143+
const target = findLastVisibleTextNode(doc) as any
144144
if (!target) {
145145
return htmlText
146146
}
147-
let newTextElement = document.createElement('b')
147+
const newTextElement = document.createElement('b')
148148
newTextElement.setAttribute('class', 'blink')
149149
if (target.nodeType === Node.TEXT_NODE) {
150150
target.parentNode.appendChild(newTextElement)

deepflow-topo-panel/src/components/AskGPT.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ export const AskGPT: React.FC<Props> = ({ data }) => {
129129
if (answerIsEnd) {
130130
return htmlText
131131
}
132-
let parser = new DOMParser()
133-
let doc = parser.parseFromString(htmlText, 'text/html')
134-
let target = findLastVisibleTextNode(doc) as any
132+
const parser = new DOMParser()
133+
const doc = parser.parseFromString(htmlText, 'text/html')
134+
const target = findLastVisibleTextNode(doc) as any
135135
if (!target) {
136136
return htmlText
137137
}
138-
let newTextElement = document.createElement('b')
138+
const newTextElement = document.createElement('b')
139139
newTextElement.setAttribute('class', 'blink')
140140
if (target.nodeType === Node.TEXT_NODE) {
141141
target.parentNode.appendChild(newTextElement)

0 commit comments

Comments
 (0)