Skip to content

Commit 8e67387

Browse files
committed
.sort -> .toSorted
1 parent e60d08f commit 8e67387

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/build-entries-and-types/build-types-pure.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ function processLines(lines) {
8686

8787
// Replace prefixed types in the entire file
8888
if (/(?::|\|)\s*\w/.test(line)) {
89-
prefixed.sort((a, b) => b.length - a.length);
90-
prefixed.forEach(item => {
89+
prefixed.toSorted((a, b) => b.length - a.length).forEach(item => {
9190
const reg = new RegExp(`(?<prepend>:||) ${ item }(?<type>[,;<)])`, 'g');
9291
line = line.replace(reg, `$<prepend> ${ NAMESPACE }${ item }$<type>`);
9392
});

0 commit comments

Comments
 (0)