indexeddbshim 19.0.6 → 19.0.7

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.
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v19.0.6 - 9/22/2026 */
1
+ /*! indexeddbshim - v19.0.7 - 9/23/2026 */
2
2
 
3
3
  'use strict';
4
4
 
@@ -3670,6 +3670,33 @@ function convertValueToMultiEntryKey(input) {
3670
3670
  return convertValueToKeyValueDecoded(input, null, true, true);
3671
3671
  }
3672
3672
 
3673
+ /**
3674
+ * @param {BufferSource|ArrayBufferLike} buffer
3675
+ * @returns {boolean}
3676
+ */
3677
+ function isBufferDetached(buffer) {
3678
+ // Use the standard property if available
3679
+ // @ts-expect-error - More recent API
3680
+ if (typeof buffer.detached === 'boolean') {
3681
+ // @ts-expect-error - More recent API
3682
+ return buffer.detached;
3683
+ }
3684
+ /* c8 ignore next 14 -- Older browsers */
3685
+
3686
+ // Fallback check via byteLength and constructor test
3687
+ if (buffer.byteLength !== 0) {
3688
+ return false;
3689
+ }
3690
+ try {
3691
+ // @ts-expect-error Ok
3692
+ // eslint-disable-next-line no-new -- Throwaway
3693
+ new Uint8Array(buffer);
3694
+ return false;
3695
+ } catch {
3696
+ return true;
3697
+ }
3698
+ }
3699
+
3673
3700
  /**
3674
3701
  *
3675
3702
  * @param {BufferSource} O
@@ -3682,15 +3709,16 @@ function getCopyBytesHeldByBufferSource(O) {
3682
3709
  let length;
3683
3710
  if (ArrayBuffer.isView(O)) {
3684
3711
  // Has [[ViewedArrayBuffer]] internal slot
3685
- const arrayBuffer = O.buffer;
3686
- if (arrayBuffer === undefined) {
3687
- throw new TypeError('Could not copy the bytes held by a buffer source as the buffer was undefined.');
3688
- }
3689
3712
  offset = O.byteOffset; // [[ByteOffset]] (will also throw as desired if detached)
3690
3713
  length = O.byteLength; // [[ByteLength]] (will also throw as desired if detached)
3691
3714
  } else {
3692
3715
  length = O.byteLength; // [[ArrayBufferByteLength]] on ArrayBuffer (will also throw as desired if detached)
3693
3716
  }
3717
+ const arrayBuffer = ArrayBuffer.isView(O) ? O.buffer : O;
3718
+ if (isBufferDetached(arrayBuffer)) {
3719
+ throw new TypeError('Could not copy the bytes held by a buffer source as the buffer was detached.');
3720
+ }
3721
+
3694
3722
  // const octets = new Uint8Array(input);
3695
3723
  // const octets = types.binary.decode(types.binary.encode(input));
3696
3724
  return new Uint8Array(