@posthog/browser-common 0.10.0 → 0.10.1

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/config.js CHANGED
@@ -27,7 +27,7 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- const packageVersion = "0.10.0";
30
+ const packageVersion = "0.10.1";
31
31
  const Config = {
32
32
  DEBUG: false,
33
33
  LIB_VERSION: packageVersion,
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const packageVersion = "0.10.0";
1
+ const packageVersion = "0.10.1";
2
2
  const Config = {
3
3
  DEBUG: false,
4
4
  LIB_VERSION: packageVersion,
@@ -140,7 +140,16 @@ const weakRandomValues = (buffer)=>{
140
140
  return buffer;
141
141
  };
142
142
  let getRandomValues;
143
- const selectRandomValues = ()=>"u" > typeof window && !(0, core_namespaceObject.isUndefined)(window.crypto) && crypto.getRandomValues ? (buffer)=>crypto.getRandomValues(buffer) : weakRandomValues;
143
+ const selectRandomValues = ()=>{
144
+ if ("u" > typeof window && !(0, core_namespaceObject.isUndefined)(window.crypto) && crypto.getRandomValues) return (buffer)=>{
145
+ try {
146
+ return crypto.getRandomValues(buffer);
147
+ } catch {
148
+ return weakRandomValues(buffer);
149
+ }
150
+ };
151
+ return weakRandomValues;
152
+ };
144
153
  class DefaultRandom {
145
154
  nextUint32() {
146
155
  if (this._cursor >= this._buffer.length) {
@@ -106,7 +106,16 @@ const weakRandomValues = (buffer)=>{
106
106
  return buffer;
107
107
  };
108
108
  let getRandomValues;
109
- const selectRandomValues = ()=>"u" > typeof window && !isUndefined(window.crypto) && crypto.getRandomValues ? (buffer)=>crypto.getRandomValues(buffer) : weakRandomValues;
109
+ const selectRandomValues = ()=>{
110
+ if ("u" > typeof window && !isUndefined(window.crypto) && crypto.getRandomValues) return (buffer)=>{
111
+ try {
112
+ return crypto.getRandomValues(buffer);
113
+ } catch {
114
+ return weakRandomValues(buffer);
115
+ }
116
+ };
117
+ return weakRandomValues;
118
+ };
110
119
  class DefaultRandom {
111
120
  nextUint32() {
112
121
  if (this._cursor >= this._buffer.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser-common",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -240,8 +240,8 @@
240
240
  },
241
241
  "dependencies": {
242
242
  "preact": "^10.29.3",
243
- "@posthog/core": "^1.61.1",
244
- "@posthog/types": "^1.418.0"
243
+ "@posthog/types": "^1.418.0",
244
+ "@posthog/core": "^1.61.1"
245
245
  },
246
246
  "devDependencies": {
247
247
  "@rsbuild/plugin-react": "^2.1.0",