@ztimson/utils 0.28.15 → 0.28.17
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 +308 -180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +308 -180
- package/dist/index.mjs.map +1 -1
- package/dist/string.d.ts +6 -0
- package/dist/xml.d.ts +20 -0
- package/package.json +1 -1
package/dist/string.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export declare const CHAR_LIST: string;
|
|
|
18
18
|
* Converts text to camelCase
|
|
19
19
|
*/
|
|
20
20
|
export declare function camelCase(str?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Decode HTML escaped characters
|
|
23
|
+
* @param html HTML to clean up
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
export declare function decodeHtml(html: string): string;
|
|
21
27
|
/**
|
|
22
28
|
* Convert number of bytes into a human-readable size
|
|
23
29
|
*
|
package/dist/xml.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses an XML string into a structured JavaScript object.
|
|
3
|
+
* @param {string} xml - The XML string to parse
|
|
4
|
+
* @returns {Object} An object with `tag`, `attributes`, and `children` properties
|
|
5
|
+
*/
|
|
6
|
+
export declare function fromXml(xml: string): any;
|
|
7
|
+
/**
|
|
8
|
+
* Converts a JavaScript object into an XML string.
|
|
9
|
+
* @param {Object} obj - Object with `tag`, `attributes`, and `children` properties, or a string
|
|
10
|
+
* @param {string} indent - Current indentation level (used internally for formatting)
|
|
11
|
+
* @returns {string} The formatted XML string
|
|
12
|
+
*/
|
|
13
|
+
export declare function toXml(obj: any, indent?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Escapes or unescapes XML special characters.
|
|
16
|
+
* @param {string} str - The string to process
|
|
17
|
+
* @param {boolean} decode - If true, decodes XML entities; if false, encodes special characters
|
|
18
|
+
* @returns {string} The processed string
|
|
19
|
+
*/
|
|
20
|
+
export declare function escapeXml(str: string, decode?: boolean): string;
|