We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81ad9c3 commit 0776542Copy full SHA for 0776542
lib/utils/lexicographically-smallest.ts
@@ -64,9 +64,10 @@ export function getLexicographicallySmallestInConcatenation(
64
} else if (set.accept.isEmpty) {
65
smallest.unshift(set.chars.ranges[0].min)
66
} else {
67
- let words = set.accept.wordSets.map(
68
- (w): Word => w.map((c) => c.ranges[0].min),
69
- )
+ let words = [
+ ...(set.chars.isEmpty ? [] : [[set.chars]]),
+ ...set.accept.wordSets,
70
+ ].map((w): Word => w.map((c) => c.ranges[0].min))
71
// we only have to consider the lexicographically smallest words with unique length
72
const seenLengths = new Set<number>()
73
words = words.sort(compareWords).filter((w) => {
0 commit comments