Skip to content

Commit 0775b64

Browse files
committed
⚒ trivial fix
1 parent e295877 commit 0775b64

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

scripts/update-unicode-properties.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type Datum = {
6767
if (!error || error.message !== "Error: socket hang up") {
6868
throw error
6969
}
70-
logger.log("Failed: %s", error)
70+
logger.log(error.message, "then retry.")
7171
await new Promise(resolve => setTimeout(resolve, 2000))
7272
}
7373
} while (window == null)
@@ -149,10 +149,9 @@ function collectValues(
149149
id: string,
150150
existingSet: Set<string>,
151151
): string[] {
152-
return Array.from(
153-
window.document.querySelectorAll(`${id} td:nth-child(1) code`),
154-
node => node.textContent || "",
155-
)
152+
const selector = `${id} td:nth-child(1) code`
153+
const nodes = window.document.querySelectorAll(selector)
154+
const values = Array.from(nodes, node => node.textContent || "")
156155
.filter(value => {
157156
if (existingSet.has(value)) {
158157
return false
@@ -161,6 +160,16 @@ function collectValues(
161160
return true
162161
})
163162
.sort(undefined)
163+
164+
logger.log(
165+
"%o nodes of %o were found, then %o adopted and %o ignored as duplication.",
166+
nodes.length,
167+
selector,
168+
values.length,
169+
nodes.length - values.length,
170+
)
171+
172+
return values
164173
}
165174

166175
function makeVerificationCode(

0 commit comments

Comments
 (0)