Skip to content

Commit cb44503

Browse files
authored
Simplify JS library de-duplication. NFC (#25941)
1 parent 22719c1 commit cb44503

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/modules.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ function calculateLibraries() {
121121

122122
if (NODERAWFS) {
123123
// NODERAWFS requires NODEFS
124-
if (!JS_LIBRARIES.includes('libnodefs.js')) {
125-
libraries.push('libnodefs.js');
126-
}
124+
libraries.push('libnodefs.js');
127125
libraries.push('libnoderawfs.js');
128126
// NODERAWFS overwrites libpath.js
129127
libraries.push('libnodepath.js');
@@ -209,7 +207,7 @@ function calculateLibraries() {
209207
libraries.push(...JS_LIBRARIES);
210208

211209
// Deduplicate libraries to avoid processing any library file multiple times
212-
libraries = libraries.filter((item, pos) => libraries.indexOf(item) == pos);
210+
libraries = [...new Set(libraries)]
213211

214212
return libraries;
215213
}

0 commit comments

Comments
 (0)