@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 CHANGED
@@ -773,6 +773,9 @@ ${opts.message || this.desc}`;
773
773
  const pascal = pascalCase(str);
774
774
  return pascal.charAt(0).toLowerCase() + pascal.slice(1);
775
775
  }
776
+ function decodeHtml(html) {
777
+ 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, "&");
778
+ }
776
779
  function formatBytes(bytes, decimals = 2) {
777
780
  if (bytes === 0) return "0 Bytes";
778
781
  const k = 1024;
@@ -3054,6 +3057,7 @@ ${err.message || err.toString()}`);
3054
3057
  exports2.dayOfYear = dayOfYear;
3055
3058
  exports2.dec2Frac = dec2Frac;
3056
3059
  exports2.dec2Hex = dec2Hex;
3060
+ exports2.decodeHtml = decodeHtml;
3057
3061
  exports2.decodeJwt = decodeJwt;
3058
3062
  exports2.deepCopy = deepCopy;
3059
3063
  exports2.deepMerge = deepMerge;