fiberx-backend-toolkit 0.0.67 → 0.0.68

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.
@@ -112,5 +112,6 @@ declare class InputTransformerUtil {
112
112
  */
113
113
  static formatLinksObject(links: Record<string, string>): Record<string, string>;
114
114
  static buildNestedObject(paths: string[]): any;
115
+ static minifyHtml(html: string): string;
115
116
  }
116
117
  export default InputTransformerUtil;
@@ -327,5 +327,20 @@ class InputTransformerUtil {
327
327
  }
328
328
  return root;
329
329
  }
330
+ // Method to minify html code
331
+ static minifyHtml(html) {
332
+ if (!html) {
333
+ return html;
334
+ }
335
+ return html
336
+ // Remove line breaks and tabs
337
+ .replace(/[\n\r\t]+/g, " ")
338
+ // Remove spaces between tags
339
+ .replace(/>\s+</g, "><")
340
+ // Collapse multiple spaces (but keep single space)
341
+ .replace(/\s{2,}/g, " ")
342
+ // Trim start and end
343
+ .trim();
344
+ }
330
345
  }
331
346
  exports.default = InputTransformerUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiberx-backend-toolkit",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "description": "A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",