@nsshunt/stsobservability 1.0.95 → 1.0.97
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.
|
@@ -4222,12 +4222,15 @@ var ExtensionCodec = (
|
|
|
4222
4222
|
return ExtensionCodec2;
|
|
4223
4223
|
}()
|
|
4224
4224
|
);
|
|
4225
|
+
function isArrayBuffer(buffer) {
|
|
4226
|
+
return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
|
|
4227
|
+
}
|
|
4225
4228
|
function ensureUint8Array(buffer) {
|
|
4226
4229
|
if (buffer instanceof Uint8Array) {
|
|
4227
4230
|
return buffer;
|
|
4228
4231
|
} else if (ArrayBuffer.isView(buffer)) {
|
|
4229
4232
|
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
4230
|
-
} else if (buffer
|
|
4233
|
+
} else if (isArrayBuffer(buffer)) {
|
|
4231
4234
|
return new Uint8Array(buffer);
|
|
4232
4235
|
} else {
|
|
4233
4236
|
return Uint8Array.from(buffer);
|
|
@@ -5723,11 +5726,15 @@ function rng() {
|
|
|
5723
5726
|
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
5724
5727
|
const native = { randomUUID };
|
|
5725
5728
|
function v4(options, buf, offset) {
|
|
5729
|
+
var _a2;
|
|
5726
5730
|
if (native.randomUUID && !buf && !options) {
|
|
5727
5731
|
return native.randomUUID();
|
|
5728
5732
|
}
|
|
5729
5733
|
options = options || {};
|
|
5730
|
-
const rnds = options.random
|
|
5734
|
+
const rnds = options.random ?? ((_a2 = options.rng) == null ? void 0 : _a2.call(options)) ?? rng();
|
|
5735
|
+
if (rnds.length < 16) {
|
|
5736
|
+
throw new Error("Random bytes length must be >= 16");
|
|
5737
|
+
}
|
|
5731
5738
|
rnds[6] = rnds[6] & 15 | 64;
|
|
5732
5739
|
rnds[8] = rnds[8] & 63 | 128;
|
|
5733
5740
|
return unsafeStringify(rnds);
|