@nsshunt/stsfhirclient 1.0.32 → 1.0.33

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.
@@ -34,11 +34,15 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
34
34
  const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
35
35
  const native = { randomUUID };
36
36
  function v4(options, buf, offset) {
37
+ var _a;
37
38
  if (native.randomUUID && !buf && !options) {
38
39
  return native.randomUUID();
39
40
  }
40
41
  options = options || {};
41
- const rnds = options.random || (options.rng || rng)();
42
+ const rnds = options.random ?? ((_a = options.rng) == null ? void 0 : _a.call(options)) ?? rng();
43
+ if (rnds.length < 16) {
44
+ throw new Error("Random bytes length must be >= 16");
45
+ }
42
46
  rnds[6] = rnds[6] & 15 | 64;
43
47
  rnds[8] = rnds[8] & 63 | 128;
44
48
  return unsafeStringify(rnds);