@arsedizioni/ars-utils 21.2.295 → 21.2.297

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.
@@ -650,6 +650,17 @@ class SystemUtils {
650
650
  return v.toString(16);
651
651
  });
652
652
  }
653
+ /**
654
+ * Reconstruct a standard UUID (with dashes) from a 32-char hex string without dashes.
655
+ * @param value : 32-character hex string
656
+ * @returns : the formatted UUID or the original string if it doesn't match the expected format
657
+ */
658
+ static inflateUUID(value) {
659
+ const s = value.trim();
660
+ if (s.length !== 32 || this.parseUUID(s))
661
+ return s;
662
+ return `${s.slice(0, 8)}-${s.slice(8, 12)}-${s.slice(12, 16)}-${s.slice(16, 20)}-${s.slice(20)}`;
663
+ }
653
664
  /**
654
665
  * Parse a text and return true if is a valid email or null
655
666
  * @param value : email