Skip to content

Commit ec337b2

Browse files
Trotttargos
authored andcommitted
tools: replace for loop with map()
Refs: #41406 (comment) Co-authored-by: Tobias Nießen <tniessen@tnie.de> PR-URL: #41451 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
1 parent fa84353 commit ec337b2

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎tools/doc/allhtml.mjs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,8 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +
101101
fs.writeFileSync(newURL('./all.html',source),all,'utf8');
102102

103103
// Validate all hrefs have a target.
104-
constids=newSet();
105104
constidRe=/id="([^"]+)"/g;
106-
constidMatches=all.matchAll(idRe);
107-
for(constmatchofidMatches){
108-
ids.add(match[1]);
109-
}
105+
constids=newSet([...all.matchAll(idRe)].map((match)=>match[1]));
110106

111107
consthrefRe=/href="#([^"]+)"/g;
112108
consthrefMatches=all.matchAll(hrefRe);

0 commit comments

Comments
 (0)