Skip to content

Commit

Permalink
Cleanup code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Jan 3, 2023
1 parent 007ce19 commit 8e0352f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/util/formatVariantSelector.js
Expand Up @@ -23,8 +23,6 @@ export function formatVariantSelector(formats, { context, candidate }) {
let prefix = context?.tailwindConfig.prefix ?? ''

// Parse the format selector into an AST
// TODO: Cache the ASTs as a given format will always have the same AST -- we'll have to clone it though if we do that
// The cache should probably go in `context`
let parsedFormats = formats.map((format) => {
let ast = selectorParser().astSync(format.format)

Expand All @@ -44,9 +42,7 @@ export function formatVariantSelector(formats, { context, candidate }) {
})

// And iteratively merge each format selector into the candidate selector
for (let format of parsedFormats) {
let ast = format.ast.clone()

for (let { ast } of parsedFormats) {
// 1. Handle :merge() special pseudo-class
;[formatAst, ast] = handleMergePseudo(formatAst, ast)

Expand Down

0 comments on commit 8e0352f

Please sign in to comment.