html-minifier-next 7.1.0 → 7.3.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.
Files changed (35) hide show
  1. package/README.md +59 -22
  2. package/cli.js +29 -4
  3. package/dist/types/htmlminifier.d.ts +77 -20
  4. package/dist/types/htmlminifier.d.ts.map +1 -1
  5. package/dist/types/htmlparser.d.ts +11 -11
  6. package/dist/types/htmlparser.d.ts.map +1 -1
  7. package/dist/types/lib/attributes.d.ts +36 -38
  8. package/dist/types/lib/attributes.d.ts.map +1 -1
  9. package/dist/types/lib/constants.d.ts +97 -100
  10. package/dist/types/lib/constants.d.ts.map +1 -1
  11. package/dist/types/lib/content.d.ts +7 -6
  12. package/dist/types/lib/content.d.ts.map +1 -1
  13. package/dist/types/lib/elements.d.ts +13 -18
  14. package/dist/types/lib/elements.d.ts.map +1 -1
  15. package/dist/types/lib/option-definitions.d.ts +202 -281
  16. package/dist/types/lib/option-definitions.d.ts.map +1 -1
  17. package/dist/types/lib/options.d.ts +7 -14
  18. package/dist/types/lib/options.d.ts.map +1 -1
  19. package/dist/types/lib/urls.d.ts +10 -2
  20. package/dist/types/lib/urls.d.ts.map +1 -1
  21. package/dist/types/lib/utils.d.ts +30 -10
  22. package/dist/types/lib/utils.d.ts.map +1 -1
  23. package/dist/types/lib/whitespace.d.ts +7 -6
  24. package/dist/types/lib/whitespace.d.ts.map +1 -1
  25. package/dist/types/presets.d.ts +39 -37
  26. package/dist/types/presets.d.ts.map +1 -1
  27. package/dist/types/tokenchain.d.ts +13 -11
  28. package/dist/types/tokenchain.d.ts.map +1 -1
  29. package/html-minifier-next.schema.json +303 -0
  30. package/package.json +8 -6
  31. package/src/htmlminifier.js +34 -1
  32. package/src/lib/option-definitions.js +12 -0
  33. package/src/lib/options.js +44 -32
  34. package/src/lib/urls.js +1 -1
  35. package/src/lib/utils.js +14 -0
@@ -1,282 +1,203 @@
1
- export namespace optionDefinitions {
2
- namespace caseSensitive {
3
- let description: string;
4
- let type: string;
5
- }
6
- namespace collapseAttributeWhitespace {
7
- let description_1: string;
8
- export { description_1 as description };
9
- let type_1: string;
10
- export { type_1 as type };
11
- }
12
- namespace collapseBooleanAttributes {
13
- let description_2: string;
14
- export { description_2 as description };
15
- let type_2: string;
16
- export { type_2 as type };
17
- }
18
- namespace collapseInlineTagWhitespace {
19
- let description_3: string;
20
- export { description_3 as description };
21
- let type_3: string;
22
- export { type_3 as type };
23
- }
24
- namespace collapseWhitespace {
25
- let description_4: string;
26
- export { description_4 as description };
27
- let type_4: string;
28
- export { type_4 as type };
29
- }
30
- namespace conservativeCollapse {
31
- let description_5: string;
32
- export { description_5 as description };
33
- let type_5: string;
34
- export { type_5 as type };
35
- }
36
- namespace continueOnMinifyError {
37
- let description_6: string;
38
- export { description_6 as description };
39
- export let descriptionAffirmative: string;
40
- let type_6: string;
41
- export { type_6 as type };
42
- }
43
- namespace continueOnParseError {
44
- let description_7: string;
45
- export { description_7 as description };
46
- let type_7: string;
47
- export { type_7 as type };
48
- }
49
- namespace customAttrAssign {
50
- let description_8: string;
51
- export { description_8 as description };
52
- let type_8: string;
53
- export { type_8 as type };
54
- }
55
- namespace customAttrCollapse {
56
- let description_9: string;
57
- export { description_9 as description };
58
- let type_9: string;
59
- export { type_9 as type };
60
- }
61
- namespace customAttrSurround {
62
- let description_10: string;
63
- export { description_10 as description };
64
- let type_10: string;
65
- export { type_10 as type };
66
- }
67
- namespace customEventAttributes {
68
- let description_11: string;
69
- export { description_11 as description };
70
- let type_11: string;
71
- export { type_11 as type };
72
- }
73
- namespace customFragmentQuantifierLimit {
74
- let description_12: string;
75
- export { description_12 as description };
76
- let type_12: string;
77
- export { type_12 as type };
78
- }
79
- namespace decodeEntities {
80
- let description_13: string;
81
- export { description_13 as description };
82
- let type_13: string;
83
- export { type_13 as type };
84
- }
85
- namespace ignoreCustomComments {
86
- let description_14: string;
87
- export { description_14 as description };
88
- let type_14: string;
89
- export { type_14 as type };
90
- }
91
- namespace ignoreCustomFragments {
92
- let description_15: string;
93
- export { description_15 as description };
94
- let type_15: string;
95
- export { type_15 as type };
96
- }
97
- namespace includeAutoGeneratedTags {
98
- let description_16: string;
99
- export { description_16 as description };
100
- let type_16: string;
101
- export { type_16 as type };
102
- }
103
- namespace inlineCustomElements {
104
- let description_17: string;
105
- export { description_17 as description };
106
- let type_17: string;
107
- export { type_17 as type };
108
- }
109
- namespace keepClosingSlash {
110
- let description_18: string;
111
- export { description_18 as description };
112
- let type_18: string;
113
- export { type_18 as type };
114
- }
115
- namespace maxInputLength {
116
- let description_19: string;
117
- export { description_19 as description };
118
- let type_19: string;
119
- export { type_19 as type };
120
- }
121
- namespace maxLineLength {
122
- let description_20: string;
123
- export { description_20 as description };
124
- let type_20: string;
125
- export { type_20 as type };
126
- }
127
- namespace mergeScripts {
128
- let description_21: string;
129
- export { description_21 as description };
130
- let type_21: string;
131
- export { type_21 as type };
132
- }
133
- namespace minifyCSS {
134
- let description_22: string;
135
- export { description_22 as description };
136
- let type_22: string;
137
- export { type_22 as type };
138
- }
139
- namespace minifyJS {
140
- let description_23: string;
141
- export { description_23 as description };
142
- let type_23: string;
143
- export { type_23 as type };
144
- }
145
- namespace minifySVG {
146
- let description_24: string;
147
- export { description_24 as description };
148
- let type_24: string;
149
- export { type_24 as type };
150
- }
151
- namespace minifyURLs {
152
- let description_25: string;
153
- export { description_25 as description };
154
- let type_25: string;
155
- export { type_25 as type };
156
- }
157
- namespace noNewlinesBeforeTagClose {
158
- let description_26: string;
159
- export { description_26 as description };
160
- let type_26: string;
161
- export { type_26 as type };
162
- }
163
- namespace partialMarkup {
164
- let description_27: string;
165
- export { description_27 as description };
166
- let type_27: string;
167
- export { type_27 as type };
168
- }
169
- namespace preserveLineBreaks {
170
- let description_28: string;
171
- export { description_28 as description };
172
- let type_28: string;
173
- export { type_28 as type };
174
- }
175
- namespace preventAttributesEscaping {
176
- let description_29: string;
177
- export { description_29 as description };
178
- let type_29: string;
179
- export { type_29 as type };
180
- }
181
- namespace processScripts {
182
- let description_30: string;
183
- export { description_30 as description };
184
- let type_30: string;
185
- export { type_30 as type };
186
- }
187
- namespace quoteCharacter {
188
- let description_31: string;
189
- export { description_31 as description };
190
- let type_31: string;
191
- export { type_31 as type };
192
- }
193
- namespace removeAttributeQuotes {
194
- let description_32: string;
195
- export { description_32 as description };
196
- let type_32: string;
197
- export { type_32 as type };
198
- }
199
- namespace removeComments {
200
- let description_33: string;
201
- export { description_33 as description };
202
- let type_33: string;
203
- export { type_33 as type };
204
- }
205
- namespace removeDefaultTypeAttributes {
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 removeEmptyAttributes {
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 removeEmptyElements {
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 removeEmptyElementsExcept {
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 removeOptionalTags {
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 removeRedundantAttributes {
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 removeTagWhitespace {
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 sortAttributes {
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 sortClassNames {
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 trimCustomFragments {
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 useShortDoctype {
266
- let description_44: string;
267
- export { description_44 as description };
268
- let type_44: string;
269
- export { type_44 as type };
270
- }
271
- }
272
- export namespace optionDefaults {
273
- let continueOnMinifyError_1: boolean;
274
- export { continueOnMinifyError_1 as continueOnMinifyError };
275
- let ignoreCustomComments_1: RegExp[];
276
- export { ignoreCustomComments_1 as ignoreCustomComments };
277
- let ignoreCustomFragments_1: RegExp[];
278
- export { ignoreCustomFragments_1 as ignoreCustomFragments };
279
- let includeAutoGeneratedTags_1: boolean;
280
- export { includeAutoGeneratedTags_1 as includeAutoGeneratedTags };
281
- }
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 };
282
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;;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EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC"}
@@ -1,11 +1,6 @@
1
- /**
2
- * Options object produced by `processOptions` and consumed by `minifyHTML` and
3
- * the `lib/` helpers; normalization guarantees that the function-valued options
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
- export function shouldMinifyInnerHTML(options: ProcessedOptions): boolean;
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
- export function processOptions(inputOptions: MinifierOptions, { getLightningCSS, getTerser, getSwc, getSvgo, cssMinifyCache, jsMinifyCache, svgMinifyCache }?: {
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
- }): ProcessedOptions;
63
- import type { MinifierOptions } from '../htmlminifier.js';
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":";;;;;;;+BAmBa,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,IAA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AAI,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"}
@@ -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 {function(string): string} Minifier function that returns the shortest URL
12
+ * @returns {(url: string) => string} Minifier function that returns the shortest URL
5
13
  */
6
- export function createUrlMinifier(site: string): (arg0: string) => 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":"AA8EA;;;;GAIG;AACH,wCAHW,MAAM,GACJ,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM,CAyEpC"}
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
- export function stableStringify(obj: unknown): string;
6
- export class LRU {
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
- export function hashContent(str: string): string;
32
+ declare function hashContent(str: string): string;
23
33
  /** @param {string} value */
24
- export function uniqueId(value: string): string;
34
+ declare function uniqueId(value: string): string;
25
35
  /** @param {string} value */
26
- export function identity(value: string): string;
36
+ declare function identity(value: string): string;
27
37
  /**
28
38
  * @param {unknown} value
29
39
  * @returns {value is PromiseLike<any>}
30
40
  */
31
- export function isThenable(value: unknown): value is PromiseLike<any>;
41
+ declare function isThenable(value: unknown): value is PromiseLike<any>;
32
42
  /** @param {string} value */
33
- export function lowercase(value: string): string;
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
- export function replaceAsync(str: string, regex: RegExp, asyncFn: Function): Promise<string>;
51
+ declare function replaceAsync(str: string, regex: RegExp, asyncFn: Function): Promise<string>;
42
52
  /** @param {string | RegExp} value */
43
- export function parseRegExp(value: string | RegExp): RegExp | undefined;
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
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qCAHW,OAAO,GACL,MAAM,CAYlB;AAID;IACE,4BAIC;IAHC,cAAkB;IAClB,mCAAmC;IACnC,KADW,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CACX;IAEtB,0BAA0B;IAC1B,SADY,MAAM,WASjB;IACD;;;OAGG;IACH,SAHW,MAAM,SACN,OAAO,QASjB;IACD,0BAA0B;IAC1B,YADY,MAAM,QACmB;CACtC;AAID,0BAA0B;AAC1B,iCADY,MAAM,UAQjB;AAID,4BAA4B;AAC5B,gCADY,MAAM,UAOjB;AAID,4BAA4B;AAC5B,gCADY,MAAM,UAGjB;AAED;;;GAGG;AACH,kCAHW,OAAO,GACL,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,CAIrC;AAED,4BAA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