Skip to content

Commit

Permalink
chore: upadte
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Aug 17, 2022
1 parent 50545d9 commit 5d2955a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/utils/variantGroup.ts
@@ -1,6 +1,6 @@
import type MagicString from 'magic-string'

export const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.+?\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm
export const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm

export function expandVariantGroup(str: string, seperators?: ('-' | ':')[]): string
export function expandVariantGroup(str: MagicString, seperators?: ('-' | ':')[]): MagicString
Expand Down
4 changes: 2 additions & 2 deletions test/variant-group.test.ts
Expand Up @@ -33,7 +33,7 @@ describe('variant-group', () => {
expect(expandVariantGroup('b:[&:not(c)]:d:(!a z)')).toEqual('!b:[&:not(c)]:d:a b:[&:not(c)]:d:z')
})

test('square bracket case', async () => {
expect(expandVariantGroup('[&]:(a-b c-d)"')).toMatchInlineSnapshot('"[&]:a-b [&]:c-d\\""')
test('square bracket case2', async () => {
expect(expandVariantGroup('[&]:(a-b c-d)')).toEqual('[&]:a-b [&]:c-d')
})
})

0 comments on commit 5d2955a

Please sign in to comment.