Skip to content

Commit 9042e9f

Browse files
committed
replace matchAll with exec
1 parent 2e912ac commit 9042e9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/merge-classlist.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ export function mergeClassList(classList: string, configUtils: ConfigUtils) {
7474
)
7575
}
7676

77+
const SPLIT_MODIFIER_REGEX = /[:[\]]/g
78+
7779
function splitModifiers(className: string) {
7880
const modifiers = []
7981

8082
let bracketDepth = 0
8183
let modifierStart = 0
84+
let match: RegExpExecArray | null
8285

83-
for (const match of className.matchAll(/[:[\]]/g)) {
86+
while ((match = SPLIT_MODIFIER_REGEX.exec(className))) {
8487
if (match[0] === ':') {
8588
if (bracketDepth === 0) {
8689
const nextModifierStart = match.index! + 1

0 commit comments

Comments
 (0)