@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.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(/&nbsp;/g, " ").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&cent;/g, "¢").replace(/&pound;/g, "£").replace(/&yen;/g, "¥").replace(/&euro;/g, "€").replace(/&copy;/g, "©").replace(/&reg;/g, "®").replace(/&trade;/g, "™").replace(/&times;/g, "×").replace(/&divide;/g, "÷").replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec)).replace(/&#x([0-9a-fA-F]+);/g, (match, hex) => String.fromCharCode(parseInt(hex, 16))).replace(/&amp;/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,