@zero-library/common 2.3.3 → 2.3.4

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.js CHANGED
@@ -488,7 +488,14 @@ var setInterval2 = (fn, t) => {
488
488
  };
489
489
  };
490
490
  var genNonDuplicateID = () => {
491
- return crypto.randomUUID();
491
+ if (crypto?.randomUUID) {
492
+ return crypto.randomUUID();
493
+ }
494
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
495
+ const r = Math.random() * 16 | 0;
496
+ const v = c === "x" ? r : r & 3 | 8;
497
+ return v.toString(16);
498
+ });
492
499
  };
493
500
  var copyText = async (text, prompt = "\u590D\u5236\u6210\u529F") => {
494
501
  try {