Skip to content

Commit 79bbf1d

Browse files
committed
filter out empty keys
1 parent eabc5b0 commit 79bbf1d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

proxy/js/features.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ const electrification_signals = all_signals.features.filter(feature => feature.t
1717
// TODO add links to documentation
1818

1919
const requireUniqueEntries = array => {
20-
const count = Object.groupBy(array, it => it[0]);
21-
delete count['']; // icons with no name are used for icon composition
20+
const count = Object.groupBy(array.filter(it => it[0]), it => it[0]);
2221
if (Object.values(count).some(it => it.length > 1)) {
2322
const offendingEntries = Object.entries(count).filter(it => it[1].length > 1).map(it => it[0]).join(', ');
2423
throw new Error(`entries must be unique, offending entries: ${offendingEntries}`);

0 commit comments

Comments
 (0)