html-minifier-next 7.2.0 → 7.4.0
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/README.md +49 -24
- package/cli.js +40 -1
- package/dist/types/htmlminifier.d.ts +77 -20
- package/dist/types/htmlminifier.d.ts.map +1 -1
- package/dist/types/htmlparser.d.ts +11 -11
- package/dist/types/htmlparser.d.ts.map +1 -1
- package/dist/types/lib/attributes.d.ts +36 -38
- package/dist/types/lib/attributes.d.ts.map +1 -1
- package/dist/types/lib/constants.d.ts +97 -100
- package/dist/types/lib/constants.d.ts.map +1 -1
- package/dist/types/lib/content.d.ts +7 -6
- package/dist/types/lib/content.d.ts.map +1 -1
- package/dist/types/lib/elements.d.ts +13 -18
- package/dist/types/lib/elements.d.ts.map +1 -1
- package/dist/types/lib/option-definitions.d.ts +202 -299
- package/dist/types/lib/option-definitions.d.ts.map +1 -1
- package/dist/types/lib/options.d.ts +7 -14
- package/dist/types/lib/options.d.ts.map +1 -1
- package/dist/types/lib/urls.d.ts +10 -2
- package/dist/types/lib/urls.d.ts.map +1 -1
- package/dist/types/lib/utils.d.ts +30 -10
- package/dist/types/lib/utils.d.ts.map +1 -1
- package/dist/types/lib/whitespace.d.ts +7 -6
- package/dist/types/lib/whitespace.d.ts.map +1 -1
- package/dist/types/presets.d.ts +39 -37
- package/dist/types/presets.d.ts.map +1 -1
- package/dist/types/tokenchain.d.ts +13 -11
- package/dist/types/tokenchain.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/htmlminifier.js +34 -1
- package/src/lib/options.js +43 -31
- package/src/lib/urls.js +1 -1
- package/src/lib/utils.js +14 -0
|
@@ -1,300 +1,203 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
export { type_33 as type };
|
|
204
|
-
}
|
|
205
|
-
namespace quoteCharacter {
|
|
206
|
-
let description_34: string;
|
|
207
|
-
export { description_34 as description };
|
|
208
|
-
let type_34: string;
|
|
209
|
-
export { type_34 as type };
|
|
210
|
-
}
|
|
211
|
-
namespace removeAttributeQuotes {
|
|
212
|
-
let description_35: string;
|
|
213
|
-
export { description_35 as description };
|
|
214
|
-
let type_35: string;
|
|
215
|
-
export { type_35 as type };
|
|
216
|
-
}
|
|
217
|
-
namespace removeComments {
|
|
218
|
-
let description_36: string;
|
|
219
|
-
export { description_36 as description };
|
|
220
|
-
let type_36: string;
|
|
221
|
-
export { type_36 as type };
|
|
222
|
-
}
|
|
223
|
-
namespace removeDefaultTypeAttributes {
|
|
224
|
-
let description_37: string;
|
|
225
|
-
export { description_37 as description };
|
|
226
|
-
let type_37: string;
|
|
227
|
-
export { type_37 as type };
|
|
228
|
-
}
|
|
229
|
-
namespace removeEmptyAttributes {
|
|
230
|
-
let description_38: string;
|
|
231
|
-
export { description_38 as description };
|
|
232
|
-
let type_38: string;
|
|
233
|
-
export { type_38 as type };
|
|
234
|
-
}
|
|
235
|
-
namespace removeEmptyElements {
|
|
236
|
-
let description_39: string;
|
|
237
|
-
export { description_39 as description };
|
|
238
|
-
let type_39: string;
|
|
239
|
-
export { type_39 as type };
|
|
240
|
-
}
|
|
241
|
-
namespace removeEmptyElementsExcept {
|
|
242
|
-
let description_40: string;
|
|
243
|
-
export { description_40 as description };
|
|
244
|
-
let type_40: string;
|
|
245
|
-
export { type_40 as type };
|
|
246
|
-
}
|
|
247
|
-
namespace removeOptionalTags {
|
|
248
|
-
let description_41: string;
|
|
249
|
-
export { description_41 as description };
|
|
250
|
-
let type_41: string;
|
|
251
|
-
export { type_41 as type };
|
|
252
|
-
}
|
|
253
|
-
namespace removeRedundantAttributes {
|
|
254
|
-
let description_42: string;
|
|
255
|
-
export { description_42 as description };
|
|
256
|
-
let type_42: string;
|
|
257
|
-
export { type_42 as type };
|
|
258
|
-
}
|
|
259
|
-
namespace removeTagWhitespace {
|
|
260
|
-
let description_43: string;
|
|
261
|
-
export { description_43 as description };
|
|
262
|
-
let type_43: string;
|
|
263
|
-
export { type_43 as type };
|
|
264
|
-
}
|
|
265
|
-
namespace sortAttributes {
|
|
266
|
-
let description_44: string;
|
|
267
|
-
export { description_44 as description };
|
|
268
|
-
let type_44: string;
|
|
269
|
-
export { type_44 as type };
|
|
270
|
-
}
|
|
271
|
-
namespace sortClassNames {
|
|
272
|
-
let description_45: string;
|
|
273
|
-
export { description_45 as description };
|
|
274
|
-
let type_45: string;
|
|
275
|
-
export { type_45 as type };
|
|
276
|
-
}
|
|
277
|
-
namespace trimCustomFragments {
|
|
278
|
-
let description_46: string;
|
|
279
|
-
export { description_46 as description };
|
|
280
|
-
let type_46: string;
|
|
281
|
-
export { type_46 as type };
|
|
282
|
-
}
|
|
283
|
-
namespace useShortDoctype {
|
|
284
|
-
let description_47: string;
|
|
285
|
-
export { description_47 as description };
|
|
286
|
-
let type_47: string;
|
|
287
|
-
export { type_47 as type };
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
export namespace optionDefaults {
|
|
291
|
-
let continueOnMinifyError_1: boolean;
|
|
292
|
-
export { continueOnMinifyError_1 as continueOnMinifyError };
|
|
293
|
-
let ignoreCustomComments_1: RegExp[];
|
|
294
|
-
export { ignoreCustomComments_1 as ignoreCustomComments };
|
|
295
|
-
let ignoreCustomFragments_1: RegExp[];
|
|
296
|
-
export { ignoreCustomFragments_1 as ignoreCustomFragments };
|
|
297
|
-
let includeAutoGeneratedTags_1: boolean;
|
|
298
|
-
export { includeAutoGeneratedTags_1 as includeAutoGeneratedTags };
|
|
299
|
-
}
|
|
1
|
+
declare const optionDefinitions: {
|
|
2
|
+
cacheCSS: {
|
|
3
|
+
description: string;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
cacheJS: {
|
|
7
|
+
description: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
cacheSVG: {
|
|
11
|
+
description: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
caseSensitive: {
|
|
15
|
+
description: string;
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
collapseAttributeWhitespace: {
|
|
19
|
+
description: string;
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
collapseBooleanAttributes: {
|
|
23
|
+
description: string;
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
collapseInlineTagWhitespace: {
|
|
27
|
+
description: string;
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
collapseWhitespace: {
|
|
31
|
+
description: string;
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
conservativeCollapse: {
|
|
35
|
+
description: string;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
continueOnMinifyError: {
|
|
39
|
+
description: string;
|
|
40
|
+
descriptionAffirmative: string;
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
continueOnParseError: {
|
|
44
|
+
description: string;
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
customAttrAssign: {
|
|
48
|
+
description: string;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
customAttrCollapse: {
|
|
52
|
+
description: string;
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
customAttrSurround: {
|
|
56
|
+
description: string;
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
customEventAttributes: {
|
|
60
|
+
description: string;
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
customFragmentQuantifierLimit: {
|
|
64
|
+
description: string;
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
decodeEntities: {
|
|
68
|
+
description: string;
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
ignoreCustomComments: {
|
|
72
|
+
description: string;
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
ignoreCustomFragments: {
|
|
76
|
+
description: string;
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
includeAutoGeneratedTags: {
|
|
80
|
+
description: string;
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
inlineCustomElements: {
|
|
84
|
+
description: string;
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
keepClosingSlash: {
|
|
88
|
+
description: string;
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
maxInputLength: {
|
|
92
|
+
description: string;
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
maxLineLength: {
|
|
96
|
+
description: string;
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
mergeScripts: {
|
|
100
|
+
description: string;
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
minifyCSS: {
|
|
104
|
+
description: string;
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
minifyJS: {
|
|
108
|
+
description: string;
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
minifySVG: {
|
|
112
|
+
description: string;
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
minifyURLs: {
|
|
116
|
+
description: string;
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
noNewlinesBeforeTagClose: {
|
|
120
|
+
description: string;
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
partialMarkup: {
|
|
124
|
+
description: string;
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
preserveLineBreaks: {
|
|
128
|
+
description: string;
|
|
129
|
+
type: string;
|
|
130
|
+
};
|
|
131
|
+
preventAttributesEscaping: {
|
|
132
|
+
description: string;
|
|
133
|
+
type: string;
|
|
134
|
+
};
|
|
135
|
+
processScripts: {
|
|
136
|
+
description: string;
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
quoteCharacter: {
|
|
140
|
+
description: string;
|
|
141
|
+
type: string;
|
|
142
|
+
};
|
|
143
|
+
removeAttributeQuotes: {
|
|
144
|
+
description: string;
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
removeComments: {
|
|
148
|
+
description: string;
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
removeDefaultTypeAttributes: {
|
|
152
|
+
description: string;
|
|
153
|
+
type: string;
|
|
154
|
+
};
|
|
155
|
+
removeEmptyAttributes: {
|
|
156
|
+
description: string;
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
removeEmptyElements: {
|
|
160
|
+
description: string;
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
removeEmptyElementsExcept: {
|
|
164
|
+
description: string;
|
|
165
|
+
type: string;
|
|
166
|
+
};
|
|
167
|
+
removeOptionalTags: {
|
|
168
|
+
description: string;
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
removeRedundantAttributes: {
|
|
172
|
+
description: string;
|
|
173
|
+
type: string;
|
|
174
|
+
};
|
|
175
|
+
removeTagWhitespace: {
|
|
176
|
+
description: string;
|
|
177
|
+
type: string;
|
|
178
|
+
};
|
|
179
|
+
sortAttributes: {
|
|
180
|
+
description: string;
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
sortClassNames: {
|
|
184
|
+
description: string;
|
|
185
|
+
type: string;
|
|
186
|
+
};
|
|
187
|
+
trimCustomFragments: {
|
|
188
|
+
description: string;
|
|
189
|
+
type: string;
|
|
190
|
+
};
|
|
191
|
+
useShortDoctype: {
|
|
192
|
+
description: string;
|
|
193
|
+
type: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
declare const optionDefaults: {
|
|
197
|
+
continueOnMinifyError: boolean;
|
|
198
|
+
ignoreCustomComments: RegExp[];
|
|
199
|
+
ignoreCustomFragments: RegExp[];
|
|
200
|
+
includeAutoGeneratedTags: boolean;
|
|
201
|
+
};
|
|
202
|
+
export { optionDefinitions, optionDefaults };
|
|
300
203
|
//# sourceMappingURL=option-definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-definitions.d.ts","sourceRoot":"","sources":["../../../src/lib/option-definitions.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"option-definitions.d.ts","sourceRoot":"","sources":["../../../src/lib/option-definitions.js"],"names":[],"mappings":"AAEA,QAAA,MAAM,iBAAiB;IACrB,QAAQ;QACN,WAAW;QACX,IAAI;;IAEN,OAAO;QACL,WAAW;QACX,IAAI;;IAEN,QAAQ;QACN,WAAW;QACX,IAAI;;IAEN,aAAa;QACX,WAAW;QACX,IAAI;;IAEN,2BAA2B;QACzB,WAAW;QACX,IAAI;;IAEN,yBAAyB;QACvB,WAAW;QACX,IAAI;;IAEN,2BAA2B;QACzB,WAAW;QACX,IAAI;;IAEN,kBAAkB;QAChB,WAAW;QACX,IAAI;;IAEN,oBAAoB;QAClB,WAAW;QACX,IAAI;;IAEN,qBAAqB;QACnB,WAAW;QACX,sBAAsB;QACtB,IAAI;;IAEN,oBAAoB;QAClB,WAAW;QACX,IAAI;;IAEN,gBAAgB;QACd,WAAW;QACX,IAAI;;IAEN,kBAAkB;QAChB,WAAW;QACX,IAAI;;IAEN,kBAAkB;QAChB,WAAW;QACX,IAAI;;IAEN,qBAAqB;QACnB,WAAW;QACX,IAAI;;IAEN,6BAA6B;QAC3B,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,oBAAoB;QAClB,WAAW;QACX,IAAI;;IAEN,qBAAqB;QACnB,WAAW;QACX,IAAI;;IAEN,wBAAwB;QACtB,WAAW;QACX,IAAI;;IAEN,oBAAoB;QAClB,WAAW;QACX,IAAI;;IAEN,gBAAgB;QACd,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,aAAa;QACX,WAAW;QACX,IAAI;;IAEN,YAAY;QACV,WAAW;QACX,IAAI;;IAEN,SAAS;QACP,WAAW;QACX,IAAI;;IAEN,QAAQ;QACN,WAAW;QACX,IAAI;;IAEN,SAAS;QACP,WAAW;QACX,IAAI;;IAEN,UAAU;QACR,WAAW;QACX,IAAI;;IAEN,wBAAwB;QACtB,WAAW;QACX,IAAI;;IAEN,aAAa;QACX,WAAW;QACX,IAAI;;IAEN,kBAAkB;QAChB,WAAW;QACX,IAAI;;IAEN,yBAAyB;QACvB,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,qBAAqB;QACnB,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,2BAA2B;QACzB,WAAW;QACX,IAAI;;IAEN,qBAAqB;QACnB,WAAW;QACX,IAAI;;IAEN,mBAAmB;QACjB,WAAW;QACX,IAAI;;IAEN,yBAAyB;QACvB,WAAW;QACX,IAAI;;IAEN,kBAAkB;QAChB,WAAW;QACX,IAAI;;IAEN,yBAAyB;QACvB,WAAW;QACX,IAAI;;IAEN,mBAAmB;QACjB,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,cAAc;QACZ,WAAW;QACX,IAAI;;IAEN,mBAAmB;QACjB,WAAW;QACX,IAAI;;IAEN,eAAe;QACb,WAAW;QACX,IAAI;;CAEP,CAAC;AAEF,QAAA,MAAM,cAAc;IAClB,qBAAqB;IACrB,oBAAoB;IAIpB,qBAAqB;IAIrB,wBAAwB;CACzB,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* below are always present (defaulting to identity/built-in functions), and
|
|
5
|
-
* minification adds writable internal state on top of the public options
|
|
6
|
-
* (set on prototype-chain forks during SVG/MathML namespace transitions)
|
|
7
|
-
*/
|
|
8
|
-
export type ProcessedOptions = Omit<MinifierOptions, "preset" | "canCollapseWhitespace" | "canTrimWhitespace" | "ignoreCustomComments" | "log" | "minifyCSS" | "minifyJS" | "minifyURLs" | "minifySVG"> & {
|
|
1
|
+
import { LRU } from './utils.js';
|
|
2
|
+
import type { MinifierOptions, HTMLAttribute } from '../htmlminifier.js';
|
|
3
|
+
export type ProcessedOptions = Omit<MinifierOptions, 'preset' | 'canCollapseWhitespace' | 'canTrimWhitespace' | 'ignoreCustomComments' | 'log' | 'minifyCSS' | 'minifyJS' | 'minifyURLs' | 'minifySVG'> & {
|
|
9
4
|
name: (name: string) => string;
|
|
10
5
|
log: (message: any) => unknown;
|
|
11
6
|
ignoreCustomComments: RegExp[];
|
|
@@ -45,13 +40,13 @@ export type ProcessedOptions = Omit<MinifierOptions, "preset" | "canCollapseWhit
|
|
|
45
40
|
* }} ProcessedOptions
|
|
46
41
|
*/
|
|
47
42
|
/** @param {ProcessedOptions} options */
|
|
48
|
-
|
|
43
|
+
declare function shouldMinifyInnerHTML(options: ProcessedOptions): boolean;
|
|
49
44
|
/**
|
|
50
45
|
* @param {MinifierOptions} inputOptions - User-provided options
|
|
51
46
|
* @param {{getLightningCSS?: Function | undefined, getTerser?: Function | undefined, getSwc?: Function | undefined, getSvgo?: Function | undefined, cssMinifyCache?: LRU | undefined, jsMinifyCache?: LRU | undefined, svgMinifyCache?: LRU | undefined}} [deps] - Dependencies from htmlminifier.js
|
|
52
47
|
* @returns {ProcessedOptions} Normalized options with defaults applied
|
|
53
48
|
*/
|
|
54
|
-
|
|
49
|
+
declare const processOptions: (inputOptions: MinifierOptions, { getLightningCSS, getTerser, getSwc, getSvgo, cssMinifyCache, jsMinifyCache, svgMinifyCache }?: {
|
|
55
50
|
getLightningCSS?: Function | undefined;
|
|
56
51
|
getTerser?: Function | undefined;
|
|
57
52
|
getSwc?: Function | undefined;
|
|
@@ -59,8 +54,6 @@ export function processOptions(inputOptions: MinifierOptions, { getLightningCSS,
|
|
|
59
54
|
cssMinifyCache?: LRU | undefined;
|
|
60
55
|
jsMinifyCache?: LRU | undefined;
|
|
61
56
|
svgMinifyCache?: LRU | undefined;
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
import type { HTMLAttribute } from '../htmlminifier.js';
|
|
65
|
-
import { LRU } from './utils.js';
|
|
57
|
+
}) => ProcessedOptions;
|
|
58
|
+
export { shouldMinifyInnerHTML, processOptions };
|
|
66
59
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/lib/options.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/lib/options.js"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAsG,MAAM,YAAY,CAAC;AAOjI,OAAQ,KAAA,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAWrE,YAcG,gBAAgB,GAdT,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,uBAAuB,GAAG,mBAAmB,GAAG,sBAAsB,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC,GAAG;IACnL,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/B,GAAG,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IAC/B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,KAAK,OAAO,CAAC;IAC7G,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,KAAK,OAAO,CAAC;IACzG,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3F,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACrE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAkB;AAzBtB,2EAA2E;AAI3E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,wCAAwC;AACxC,iBAAS,qBAAqB,CAAC,OAAO,EAD1B,gBAC0B,WAUrC;AAYD;;;;GAIG;AACH,QAAA,MAAM,cAAc,iBAJT,eAAe,mGACf;IAAC,eAAe,CAAC,EAAE,WAAW,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,WAAW,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,GAAG,GAAG,SAAS,CAAA;CAAC,KAC5O,gBA0ZZ,CAAC;AAIF,OAAO,EACL,qBAAqB,EACrB,cAAc,EACf,CAAC"}
|
package/dist/types/lib/urls.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL minification using Node’s WHATWG URL API
|
|
3
|
+
*
|
|
4
|
+
* Produces the shortest equivalent URL representation:
|
|
5
|
+
* - Same origin: shortest of root-relative or path-relative
|
|
6
|
+
* - Cross-origin, same scheme: scheme-relative (`//host/path`)
|
|
7
|
+
* - Otherwise: normalized absolute URL
|
|
8
|
+
*/
|
|
1
9
|
/**
|
|
2
10
|
* Create a URL minifier function for the given site context
|
|
3
11
|
* @param {string} site - The site base URL (used to compute relative URLs)
|
|
4
|
-
* @returns {
|
|
12
|
+
* @returns {(url: string) => string} Minifier function that returns the shortest URL
|
|
5
13
|
*/
|
|
6
|
-
export function createUrlMinifier(site: string): (
|
|
14
|
+
export declare function createUrlMinifier(site: string): (url: string) => string;
|
|
7
15
|
//# sourceMappingURL=urls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../../src/lib/urls.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../../src/lib/urls.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuEH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAH3B,MAG2B,GAFzB,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAyEnC"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* @param {unknown} obj
|
|
3
3
|
* @returns {string}
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(limit?: number);
|
|
5
|
+
declare function stableStringify(obj: unknown): string;
|
|
6
|
+
declare class LRU {
|
|
8
7
|
limit: number;
|
|
8
|
+
gets: number;
|
|
9
|
+
hits: number;
|
|
9
10
|
/** @type {Map<string, unknown>} */
|
|
10
11
|
map: Map<string, unknown>;
|
|
12
|
+
constructor(limit?: number);
|
|
11
13
|
/** @param {string} key */
|
|
12
14
|
get(key: string): unknown;
|
|
13
15
|
/**
|
|
@@ -17,20 +19,28 @@ export class LRU {
|
|
|
17
19
|
set(key: string, value: unknown): void;
|
|
18
20
|
/** @param {string} key */
|
|
19
21
|
delete(key: string): void;
|
|
22
|
+
/** @returns {{ gets: number, hits: number, size: number, limit: number }} */
|
|
23
|
+
stats(): {
|
|
24
|
+
gets: number;
|
|
25
|
+
hits: number;
|
|
26
|
+
size: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
};
|
|
20
29
|
}
|
|
30
|
+
declare const MAX_CACHE_ENTRY_SIZE: number;
|
|
21
31
|
/** @param {string} str */
|
|
22
|
-
|
|
32
|
+
declare function hashContent(str: string): string;
|
|
23
33
|
/** @param {string} value */
|
|
24
|
-
|
|
34
|
+
declare function uniqueId(value: string): string;
|
|
25
35
|
/** @param {string} value */
|
|
26
|
-
|
|
36
|
+
declare function identity(value: string): string;
|
|
27
37
|
/**
|
|
28
38
|
* @param {unknown} value
|
|
29
39
|
* @returns {value is PromiseLike<any>}
|
|
30
40
|
*/
|
|
31
|
-
|
|
41
|
+
declare function isThenable(value: unknown): value is PromiseLike<any>;
|
|
32
42
|
/** @param {string} value */
|
|
33
|
-
|
|
43
|
+
declare function lowercase(value: string): string;
|
|
34
44
|
/**
|
|
35
45
|
* Asynchronously replace matches in a string
|
|
36
46
|
* @param {string} str - Input string
|
|
@@ -38,7 +48,17 @@ export function lowercase(value: string): string;
|
|
|
38
48
|
* @param {Function} asyncFn - Async function to process each match
|
|
39
49
|
* @returns {Promise<string>} Processed string
|
|
40
50
|
*/
|
|
41
|
-
|
|
51
|
+
declare function replaceAsync(str: string, regex: RegExp, asyncFn: Function): Promise<string>;
|
|
42
52
|
/** @param {string | RegExp} value */
|
|
43
|
-
|
|
53
|
+
declare function parseRegExp(value: string | RegExp): RegExp | undefined;
|
|
54
|
+
export { stableStringify };
|
|
55
|
+
export { LRU };
|
|
56
|
+
export { MAX_CACHE_ENTRY_SIZE };
|
|
57
|
+
export { hashContent };
|
|
58
|
+
export { uniqueId };
|
|
59
|
+
export { identity };
|
|
60
|
+
export { isThenable };
|
|
61
|
+
export { lowercase };
|
|
62
|
+
export { replaceAsync };
|
|
63
|
+
export { parseRegExp };
|
|
44
64
|
//# sourceMappingURL=utils.d.ts.map
|