@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 +1 -1
- package/dist/config.mjs +1 -1
- package/dist/utils/uuidv7.js +10 -1
- package/dist/utils/uuidv7.mjs +10 -1
- package/package.json +3 -3
package/dist/config.js
CHANGED
package/dist/config.mjs
CHANGED
package/dist/utils/uuidv7.js
CHANGED
|
@@ -140,7 +140,16 @@ const weakRandomValues = (buffer)=>{
|
|
|
140
140
|
return buffer;
|
|
141
141
|
};
|
|
142
142
|
let getRandomValues;
|
|
143
|
-
const selectRandomValues = ()=>
|
|
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) {
|
package/dist/utils/uuidv7.mjs
CHANGED
|
@@ -106,7 +106,16 @@ const weakRandomValues = (buffer)=>{
|
|
|
106
106
|
return buffer;
|
|
107
107
|
};
|
|
108
108
|
let getRandomValues;
|
|
109
|
-
const selectRandomValues = ()=>
|
|
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.
|
|
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/
|
|
244
|
-
"@posthog/
|
|
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",
|