@tailwindcss-mangle/shared 2.1.0 → 2.2.1
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.
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +56 -0
- package/dist/index.d.mts +56 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +11 -0
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -67,8 +67,19 @@ function regExpTest(arr = [], str) {
|
|
|
67
67
|
throw new TypeError("paramater 'arr' should be a Array of Regexp | String !");
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
var __defProp = Object.defineProperty;
|
|
71
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
72
|
+
var __publicField = (obj, key, value) => {
|
|
73
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
74
|
+
return value;
|
|
75
|
+
};
|
|
70
76
|
class ClassGenerator {
|
|
71
77
|
constructor(opts = {}) {
|
|
78
|
+
__publicField(this, "newClassMap");
|
|
79
|
+
__publicField(this, "newClassSize");
|
|
80
|
+
__publicField(this, "context");
|
|
81
|
+
__publicField(this, "opts");
|
|
82
|
+
__publicField(this, "classPrefix");
|
|
72
83
|
this.newClassMap = {};
|
|
73
84
|
this.newClassSize = 0;
|
|
74
85
|
this.context = {};
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
interface IClassGeneratorContextItem {
|
|
2
|
+
name: string;
|
|
3
|
+
usedBy: Set<string>;
|
|
4
|
+
}
|
|
5
|
+
interface IClassGeneratorOptions {
|
|
6
|
+
reserveClassName?: (string | RegExp)[];
|
|
7
|
+
customGenerate?: (original: string, opts: IClassGeneratorOptions, context: Record<string, any>) => string | undefined;
|
|
8
|
+
log?: boolean;
|
|
9
|
+
exclude?: (string | RegExp)[];
|
|
10
|
+
include?: (string | RegExp)[];
|
|
11
|
+
ignoreClass?: (string | RegExp)[];
|
|
12
|
+
classPrefix?: string;
|
|
13
|
+
}
|
|
14
|
+
interface IClassGenerator {
|
|
15
|
+
newClassMap: Record<string, IClassGeneratorContextItem>;
|
|
16
|
+
newClassSize: number;
|
|
17
|
+
context: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare class ClassGenerator implements IClassGenerator {
|
|
21
|
+
newClassMap: Record<string, IClassGeneratorContextItem>;
|
|
22
|
+
newClassSize: number;
|
|
23
|
+
context: Record<string, any>;
|
|
24
|
+
opts: IClassGeneratorOptions;
|
|
25
|
+
classPrefix: string;
|
|
26
|
+
constructor(opts?: IClassGeneratorOptions);
|
|
27
|
+
defaultClassGenerate(): string;
|
|
28
|
+
ignoreClassName(className: string): boolean;
|
|
29
|
+
includeFilePath(filePath: string): boolean;
|
|
30
|
+
excludeFilePath(filePath: string): boolean;
|
|
31
|
+
isFileIncluded(filePath: string): boolean;
|
|
32
|
+
transformCssClass(className: string): string;
|
|
33
|
+
generateClassName(original: string): IClassGeneratorContextItem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function escapeStringRegexp(str: string): string;
|
|
37
|
+
declare function makeRegex(str: string, options?: {
|
|
38
|
+
exact: boolean;
|
|
39
|
+
}): RegExp;
|
|
40
|
+
|
|
41
|
+
declare const validateFilterRE: RegExp;
|
|
42
|
+
declare function isValidSelector(selector?: string): selector is string;
|
|
43
|
+
declare const splitCode: (code: string, options?: {
|
|
44
|
+
splitQuote?: boolean;
|
|
45
|
+
}) => string[];
|
|
46
|
+
|
|
47
|
+
declare const preserveClassNames: string[];
|
|
48
|
+
declare const defaultMangleClassFilter: (className: string) => boolean;
|
|
49
|
+
declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<string, T[]>;
|
|
50
|
+
declare const acceptChars: string[];
|
|
51
|
+
declare function stripEscapeSequence(words: string): string;
|
|
52
|
+
declare function isRegexp(value: unknown): boolean;
|
|
53
|
+
declare function isMap(value: unknown): boolean;
|
|
54
|
+
declare function regExpTest(arr: (string | RegExp)[] | undefined, str: string): boolean;
|
|
55
|
+
|
|
56
|
+
export { ClassGenerator, type IClassGenerator, type IClassGeneratorContextItem, type IClassGeneratorOptions, acceptChars, defaultMangleClassFilter, escapeStringRegexp, groupBy, isMap, isRegexp, isValidSelector, makeRegex, preserveClassNames, regExpTest, splitCode, stripEscapeSequence, validateFilterRE };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
interface IClassGeneratorContextItem {
|
|
2
|
+
name: string;
|
|
3
|
+
usedBy: Set<string>;
|
|
4
|
+
}
|
|
5
|
+
interface IClassGeneratorOptions {
|
|
6
|
+
reserveClassName?: (string | RegExp)[];
|
|
7
|
+
customGenerate?: (original: string, opts: IClassGeneratorOptions, context: Record<string, any>) => string | undefined;
|
|
8
|
+
log?: boolean;
|
|
9
|
+
exclude?: (string | RegExp)[];
|
|
10
|
+
include?: (string | RegExp)[];
|
|
11
|
+
ignoreClass?: (string | RegExp)[];
|
|
12
|
+
classPrefix?: string;
|
|
13
|
+
}
|
|
14
|
+
interface IClassGenerator {
|
|
15
|
+
newClassMap: Record<string, IClassGeneratorContextItem>;
|
|
16
|
+
newClassSize: number;
|
|
17
|
+
context: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare class ClassGenerator implements IClassGenerator {
|
|
21
|
+
newClassMap: Record<string, IClassGeneratorContextItem>;
|
|
22
|
+
newClassSize: number;
|
|
23
|
+
context: Record<string, any>;
|
|
24
|
+
opts: IClassGeneratorOptions;
|
|
25
|
+
classPrefix: string;
|
|
26
|
+
constructor(opts?: IClassGeneratorOptions);
|
|
27
|
+
defaultClassGenerate(): string;
|
|
28
|
+
ignoreClassName(className: string): boolean;
|
|
29
|
+
includeFilePath(filePath: string): boolean;
|
|
30
|
+
excludeFilePath(filePath: string): boolean;
|
|
31
|
+
isFileIncluded(filePath: string): boolean;
|
|
32
|
+
transformCssClass(className: string): string;
|
|
33
|
+
generateClassName(original: string): IClassGeneratorContextItem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function escapeStringRegexp(str: string): string;
|
|
37
|
+
declare function makeRegex(str: string, options?: {
|
|
38
|
+
exact: boolean;
|
|
39
|
+
}): RegExp;
|
|
40
|
+
|
|
41
|
+
declare const validateFilterRE: RegExp;
|
|
42
|
+
declare function isValidSelector(selector?: string): selector is string;
|
|
43
|
+
declare const splitCode: (code: string, options?: {
|
|
44
|
+
splitQuote?: boolean;
|
|
45
|
+
}) => string[];
|
|
46
|
+
|
|
47
|
+
declare const preserveClassNames: string[];
|
|
48
|
+
declare const defaultMangleClassFilter: (className: string) => boolean;
|
|
49
|
+
declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<string, T[]>;
|
|
50
|
+
declare const acceptChars: string[];
|
|
51
|
+
declare function stripEscapeSequence(words: string): string;
|
|
52
|
+
declare function isRegexp(value: unknown): boolean;
|
|
53
|
+
declare function isMap(value: unknown): boolean;
|
|
54
|
+
declare function regExpTest(arr: (string | RegExp)[] | undefined, str: string): boolean;
|
|
55
|
+
|
|
56
|
+
export { ClassGenerator, type IClassGenerator, type IClassGeneratorContextItem, type IClassGeneratorOptions, acceptChars, defaultMangleClassFilter, escapeStringRegexp, groupBy, isMap, isRegexp, isValidSelector, makeRegex, preserveClassNames, regExpTest, splitCode, stripEscapeSequence, validateFilterRE };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,4 +53,4 @@ declare function isRegexp(value: unknown): boolean;
|
|
|
53
53
|
declare function isMap(value: unknown): boolean;
|
|
54
54
|
declare function regExpTest(arr: (string | RegExp)[] | undefined, str: string): boolean;
|
|
55
55
|
|
|
56
|
-
export { ClassGenerator, IClassGenerator, IClassGeneratorContextItem, IClassGeneratorOptions, acceptChars, defaultMangleClassFilter, escapeStringRegexp, groupBy, isMap, isRegexp, isValidSelector, makeRegex, preserveClassNames, regExpTest, splitCode, stripEscapeSequence, validateFilterRE };
|
|
56
|
+
export { ClassGenerator, type IClassGenerator, type IClassGeneratorContextItem, type IClassGeneratorOptions, acceptChars, defaultMangleClassFilter, escapeStringRegexp, groupBy, isMap, isRegexp, isValidSelector, makeRegex, preserveClassNames, regExpTest, splitCode, stripEscapeSequence, validateFilterRE };
|
package/dist/index.mjs
CHANGED
|
@@ -65,8 +65,19 @@ function regExpTest(arr = [], str) {
|
|
|
65
65
|
throw new TypeError("paramater 'arr' should be a Array of Regexp | String !");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
var __defProp = Object.defineProperty;
|
|
69
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
70
|
+
var __publicField = (obj, key, value) => {
|
|
71
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
72
|
+
return value;
|
|
73
|
+
};
|
|
68
74
|
class ClassGenerator {
|
|
69
75
|
constructor(opts = {}) {
|
|
76
|
+
__publicField(this, "newClassMap");
|
|
77
|
+
__publicField(this, "newClassSize");
|
|
78
|
+
__publicField(this, "context");
|
|
79
|
+
__publicField(this, "opts");
|
|
80
|
+
__publicField(this, "classPrefix");
|
|
70
81
|
this.newClassMap = {};
|
|
71
82
|
this.newClassSize = 0;
|
|
72
83
|
this.context = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/shared",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "The shared utils of tailwindcss-mangle",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"url": "git+https://github.com/sonofmagic/tailwindcss-mangle.git"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
+
"dev": "unbuild --sourcemap",
|
|
48
49
|
"build": "unbuild",
|
|
49
50
|
"test": "vitest run --coverage.enabled",
|
|
50
51
|
"test:dev": "vitest"
|