Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ export class Magician {
if (CLASS_MATCHES.length < 1) return this
for (const match of CLASS_MATCHES) {
const cleanMatch = match.groups?.classes
.replaceAll(/windi[`].+?[`]/gi, ' ') // windi`XYZ`
.replaceAll(/(?<![-])[$](?=[{])/gi, ' ') // if leading char is not -, and next char is {, then remove $
.replaceAll(/(?<=([{][\w\s]+[^{]*?))['"]/gi, ' ') // remove quotes in curly braces
.replaceAll(/(?<=([{][\w\s]+[^{]*?)\s)[:]/gi, ' ') // remove : in curly braces
.replaceAll(/([{][\w\s]+[^{]*?[?])/gi, ' ') // remove ? and condition in curly braces
.replaceAll(/[{}]/gi, ' ') // remove curly braces
.replaceAll(/\n/gi, ' ') // remove newline
.replaceAll(/ {2,}/gi, ' ') // remove multiple spaces
.replaceAll(/["'`]/gi, '') // remove quotes
.replace(/windi[`].+?[`]/gi, ' ') // windi`XYZ`
.replace(/(?<![-])[$](?=[{])/gi, ' ') // if leading char is not -, and next char is {, then remove $
.replace(/(?<=([{][\w\s]+[^{]*?))['"]/gi, ' ') // remove quotes in curly braces
.replace(/(?<=([{][\w\s]+[^{]*?)\s)[:]/gi, ' ') // remove : in curly braces
.replace(/([{][\w\s]+[^{]*?[?])/gi, ' ') // remove ? and condition in curly braces
.replace(/[{}]/gi, ' ') // remove curly braces
.replace(/\n/gi, ' ') // remove newline
.replace(/ {2,}/gi, ' ') // remove multiple spaces
.replace(/["'`]/gi, '') // remove quotes

this.classes = this.classes.concat(
(cleanMatch || '').split(' ').filter(c => {
Expand All @@ -126,15 +126,15 @@ export class Magician {
if (CLASS_MATCHES.length < 1) return this
for (const match of CLASS_MATCHES) {
const cleanMatch = match.groups?.classes
.replaceAll(/windi[`].+?[`]/gi, ' ') // windi`XYZ`
.replaceAll(/(?<![-])[$](?=[{])/gi, ' ') // if leading char is not -, and next char is {, then remove $
.replaceAll(/(?<=([{][\w\s]+[^{]*?))['"]/gi, ' ') // remove quotes in curly braces
.replaceAll(/(?<=([{][\w\s]+[^{]*?)\s)[:]/gi, ' ') // remove : in curly braces
.replaceAll(/([{][\w\s]+[^{]*?[?])/gi, ' ') // remove ? and condition in curly braces
.replaceAll(/[{}]/gi, ' ') // remove curly braces
.replaceAll(/\n/gi, ' ') // remove newline
.replaceAll(/ {2,}/gi, ' ') // remove multiple spaces
.replaceAll(/["'`]/gi, '') // remove quotes
.replace(/windi[`].+?[`]/gi, ' ') // windi`XYZ`
.replace(/(?<![-])[$](?=[{])/gi, ' ') // if leading char is not -, and next char is {, then remove $
.replace(/(?<=([{][\w\s]+[^{]*?))['"]/gi, ' ') // remove quotes in curly braces
.replace(/(?<=([{][\w\s]+[^{]*?)\s)[:]/gi, ' ') // remove : in curly braces
.replace(/([{][\w\s]+[^{]*?[?])/gi, ' ') // remove ? and condition in curly braces
.replace(/[{}]/gi, ' ') // remove curly braces
.replace(/\n/gi, ' ') // remove newline
.replace(/ {2,}/gi, ' ') // remove multiple spaces
.replace(/["'`]/gi, '') // remove quotes

this.classes = this.classes.concat(
(cleanMatch || '').split(' ').filter(c => {
Expand Down