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
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -4080,6 +4080,33 @@
4080
4080
  return convertValueToKeyValueDecoded(input, null, true, true);
4081
4081
  }
4082
4082
 
4083
+ /**
4084
+ * @param {BufferSource|ArrayBufferLike} buffer
4085
+ * @returns {boolean}
4086
+ */
4087
+ function isBufferDetached(buffer) {
4088
+ // Use the standard property if available
4089
+ // @ts-expect-error - More recent API
4090
+ if (typeof buffer.detached === 'boolean') {
4091
+ // @ts-expect-error - More recent API
4092
+ return buffer.detached;
4093
+ }
4094
+ /* c8 ignore next 14 -- Older browsers */
4095
+
4096
+ // Fallback check via byteLength and constructor test
4097
+ if (buffer.byteLength !== 0) {
4098
+ return false;
4099
+ }
4100
+ try {
4101
+ // @ts-expect-error Ok
4102
+ // eslint-disable-next-line no-new -- Throwaway
4103
+ new Uint8Array(buffer);
4104
+ return false;
4105
+ } catch (_unused) {
4106
+ return true;
4107
+ }
4108
+ }
4109
+
4083
4110
  /**
4084
4111
  *
4085
4112
  * @param {BufferSource} O
@@ -4092,15 +4119,16 @@
4092
4119
  var length;
4093
4120
  if (ArrayBuffer.isView(O)) {
4094
4121
  // Has [[ViewedArrayBuffer]] internal slot
4095
- var arrayBuffer = O.buffer;
4096
- if (arrayBuffer === undefined) {
4097
- throw new TypeError('Could not copy the bytes held by a buffer source as the buffer was undefined.');
4098
- }
4099
4122
  offset = O.byteOffset; // [[ByteOffset]] (will also throw as desired if detached)
4100
4123
  length = O.byteLength; // [[ByteLength]] (will also throw as desired if detached)
4101
4124
  } else {
4102
4125
  length = O.byteLength; // [[ArrayBufferByteLength]] on ArrayBuffer (will also throw as desired if detached)
4103
4126
  }
4127
+ var arrayBuffer = ArrayBuffer.isView(O) ? O.buffer : O;
4128
+ if (isBufferDetached(arrayBuffer)) {
4129
+ throw new TypeError('Could not copy the bytes held by a buffer source as the buffer was detached.');
4130
+ }
4131
+
4104
4132
  // const octets = new Uint8Array(input);
4105
4133
  // const octets = types.binary.decode(types.binary.encode(input));
4106
4134
  return new Uint8Array(
@@ -4172,7 +4200,7 @@
4172
4200
  var octets;
4173
4201
  try {
4174
4202
  octets = getCopyBytesHeldByBufferSource(/** @type {BufferSource} */input);
4175
- } catch (_unused) {
4203
+ } catch (_unused2) {
4176
4204
  return {
4177
4205
  type: type,
4178
4206
  invalid: true,