@popsure/dirty-swan 0.28.4 → 0.28.5

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/cjs/index.js CHANGED
@@ -5150,7 +5150,7 @@ var isEqual = lodash_isequal.exports;
5150
5150
 
5151
5151
  function generateId() {
5152
5152
  var _a;
5153
- if ((_a = window === null || window === void 0 ? void 0 : window.crypto) === null || _a === void 0 ? void 0 : _a.getRandomValues) {
5153
+ if (typeof window !== "undefined" && ((_a = window === null || window === void 0 ? void 0 : window.crypto) === null || _a === void 0 ? void 0 : _a.getRandomValues)) {
5154
5154
  return ([1e7] + "-" + 1e3 + "-" + 4e3 + "-" + 8e3 + "-" + 1e11).replace(/[018]/g, function (c) {
5155
5155
  return (((c ^ window.crypto.getRandomValues(new Uint8Array(1))[0]) & 15) >> c / 4).toString(16);
5156
5156
  });