@tailwindcss-obfuscator/core 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,16 +52,18 @@ function findClassStrings(code) {
|
|
|
52
52
|
let match = stringRegex.exec(call.content);
|
|
53
53
|
while (match !== null) {
|
|
54
54
|
const [fullMatch, , classString] = match;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (classString.length >= 2 && classString !== "/") {
|
|
56
|
+
matches.push({
|
|
57
|
+
classString,
|
|
58
|
+
end: call.start + match.index + fullMatch.length,
|
|
59
|
+
fullMatch,
|
|
60
|
+
start: call.start + match.index
|
|
61
|
+
});
|
|
62
|
+
}
|
|
61
63
|
match = stringRegex.exec(call.content);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
const jsxClassNameRegex = /className\s*=\s*(?:\{
|
|
66
|
+
const jsxClassNameRegex = /className\s*=\s*(?:\{\s*["'`]([^"'`]+)["'`]\s*\}|["'`]([^"'`]+)["'`])/g;
|
|
65
67
|
const compiledClassNameRegex = /className\s*:\s*(["'`])([^"'`]+)\1/g;
|
|
66
68
|
for (const { regex, getClassString } of [
|
|
67
69
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-class-strings.d.ts","sourceRoot":"","sources":["../src/find-class-strings.ts"],"names":[],"mappings":"AAsDA,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"find-class-strings.d.ts","sourceRoot":"","sources":["../src/find-class-strings.ts"],"names":[],"mappings":"AAsDA,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA0DjE"}
|
|
@@ -52,16 +52,18 @@ function findClassStrings(code) {
|
|
|
52
52
|
let match = stringRegex.exec(call.content);
|
|
53
53
|
while (match !== null) {
|
|
54
54
|
const [fullMatch, , classString] = match;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (classString.length >= 2 && classString !== "/") {
|
|
56
|
+
matches.push({
|
|
57
|
+
classString,
|
|
58
|
+
end: call.start + match.index + fullMatch.length,
|
|
59
|
+
fullMatch,
|
|
60
|
+
start: call.start + match.index
|
|
61
|
+
});
|
|
62
|
+
}
|
|
61
63
|
match = stringRegex.exec(call.content);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
const jsxClassNameRegex = /className\s*=\s*(?:\{
|
|
66
|
+
const jsxClassNameRegex = /className\s*=\s*(?:\{\s*["'`]([^"'`]+)["'`]\s*\}|["'`]([^"'`]+)["'`])/g;
|
|
65
67
|
const compiledClassNameRegex = /className\s*:\s*(["'`])([^"'`]+)\1/g;
|
|
66
68
|
for (const { regex, getClassString } of [
|
|
67
69
|
{
|
package/package.json
CHANGED