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