@ztimson/utils 0.28.15 → 0.28.16
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 +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/string.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -769,6 +769,9 @@ function camelCase(str) {
|
|
|
769
769
|
const pascal = pascalCase(str);
|
|
770
770
|
return pascal.charAt(0).toLowerCase() + pascal.slice(1);
|
|
771
771
|
}
|
|
772
|
+
function decodeHtml(html) {
|
|
773
|
+
return html.replace(/ /g, " ").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/¢/g, "¢").replace(/£/g, "£").replace(/¥/g, "¥").replace(/€/g, "€").replace(/©/g, "©").replace(/®/g, "®").replace(/™/g, "™").replace(/×/g, "×").replace(/÷/g, "÷").replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec)).replace(/&#x([0-9a-fA-F]+);/g, (match, hex) => String.fromCharCode(parseInt(hex, 16))).replace(/&/g, "&");
|
|
774
|
+
}
|
|
772
775
|
function formatBytes(bytes, decimals = 2) {
|
|
773
776
|
if (bytes === 0) return "0 Bytes";
|
|
774
777
|
const k = 1024;
|
|
@@ -3051,6 +3054,7 @@ export {
|
|
|
3051
3054
|
dayOfYear,
|
|
3052
3055
|
dec2Frac,
|
|
3053
3056
|
dec2Hex,
|
|
3057
|
+
decodeHtml,
|
|
3054
3058
|
decodeJwt,
|
|
3055
3059
|
deepCopy,
|
|
3056
3060
|
deepMerge,
|