Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit a54c6fd

Browse files
committed
Add test
1 parent a4df8ee commit a54c6fd

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/lib/generateRules.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function* candidatePermutations(candidate, lastIndex = Infinity) {
2323

2424
let dashIdx
2525

26-
if (candidate.endsWith(']', /*length*/ lastIndex + 1)) {
26+
if (candidate.endsWith(']', lastIndex + 1)) {
2727
dashIdx = candidate.lastIndexOf('[') - 1
2828
} else {
2929
dashIdx = candidate.lastIndexOf('-', lastIndex)
@@ -33,7 +33,7 @@ function* candidatePermutations(candidate, lastIndex = Infinity) {
3333
return
3434
}
3535

36-
let prefix = candidate.slice(0, candidate.charAt(dashIdx) === '-' ? dashIdx : dashIdx + 1)
36+
let prefix = candidate.slice(0, dashIdx)
3737
let modifier = candidate.slice(dashIdx + 1)
3838

3939
yield [prefix, modifier]

tests/00-kitchen-sink.test.html

+20
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,23 @@
5252
<div class="text-center shadow-md hover:shadow-lg transform scale-50 hover:scale-75"></div>
5353
</body>
5454
</html>
55+
56+
<script>
57+
defineComponent({
58+
name: 'HelloWorld',
59+
props: {
60+
msg: {
61+
type: String,
62+
required: true,
63+
},
64+
things: Array /* PropType<string[]> */,
65+
},
66+
setup: () => {
67+
const count = ref(0)
68+
return {
69+
count,
70+
stuff: [] /* string[] | undefined */,
71+
}
72+
},
73+
})
74+
</script>

0 commit comments

Comments
 (0)