@firesystem/indexeddb
Version:
IndexedDB implementation of Virtual File System
1 lines • 438 kB
Source Map (JSON)
{"version":3,"sources":["../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/errors.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/valueToKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/cmp.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBKeyRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/extractKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBCursor.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBCursorWithValue.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/FakeEventTarget.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBRequest.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/enforceRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/FakeDOMStringList.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/valueToKeyRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBIndex.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/canInjectKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/binarySearch.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/RecordStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/Index.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/validateKeyPath.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBObjectStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/FakeEvent.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/scheduling.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBTransaction.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/KeyGenerator.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/ObjectStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBDatabase.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBOpenDBRequest.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBVersionChangeEvent.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/lib/Database.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/FDBFactory.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/cjs/fakeIndexedDB.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/auto/index.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/errors.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/valueToKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/cmp.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBKeyRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/extractKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBCursor.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBCursorWithValue.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/FakeEventTarget.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBRequest.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/enforceRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/FakeDOMStringList.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/valueToKeyRange.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBIndex.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/canInjectKey.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/binarySearch.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/RecordStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/Index.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/validateKeyPath.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBObjectStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/FakeEvent.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/scheduling.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBTransaction.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/KeyGenerator.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/ObjectStore.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBDatabase.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBOpenDBRequest.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBVersionChangeEvent.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/lib/Database.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/FDBFactory.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/build/esm/fakeIndexedDB.js","../../../node_modules/.pnpm/fake-indexeddb@6.0.1/node_modules/fake-indexeddb/auto/index.mjs","../src/testing.ts","../src/IndexedDBFileSystem.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VersionError = exports.TransactionInactiveError = exports.ReadOnlyError = exports.NotFoundError = exports.InvalidStateError = exports.InvalidAccessError = exports.DataError = exports.DataCloneError = exports.ConstraintError = exports.AbortError = void 0;\nconst messages = {\n AbortError: \"A request was aborted, for example through a call to IDBTransaction.abort.\",\n ConstraintError: \"A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object such as an object store or index already exists and a request attempted to create a new one.\",\n DataCloneError: \"The data being stored could not be cloned by the internal structured cloning algorithm.\",\n DataError: \"Data provided to an operation does not meet requirements.\",\n InvalidAccessError: \"An invalid operation was performed on an object. For example transaction creation attempt was made, but an empty scope was provided.\",\n InvalidStateError: \"An operation was called on an object on which it is not allowed or at a time when it is not allowed. Also occurs if a request is made on a source object that has been deleted or removed. Use TransactionInactiveError or ReadOnlyError when possible, as they are more specific variations of InvalidStateError.\",\n NotFoundError: \"The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.\",\n ReadOnlyError: 'The mutating operation was attempted in a \"readonly\" transaction.',\n TransactionInactiveError: \"A request was placed against a transaction which is currently not active, or which is finished.\",\n VersionError: \"An attempt was made to open a database using a lower version than the existing version.\"\n};\nclass AbortError extends DOMException {\n constructor(message = messages.AbortError) {\n super(message, \"AbortError\");\n }\n}\nexports.AbortError = AbortError;\nclass ConstraintError extends DOMException {\n constructor(message = messages.ConstraintError) {\n super(message, \"ConstraintError\");\n }\n}\nexports.ConstraintError = ConstraintError;\nclass DataCloneError extends DOMException {\n constructor(message = messages.DataCloneError) {\n super(message, \"DataCloneError\");\n }\n}\nexports.DataCloneError = DataCloneError;\nclass DataError extends DOMException {\n constructor(message = messages.DataError) {\n super(message, \"DataError\");\n }\n}\nexports.DataError = DataError;\nclass InvalidAccessError extends DOMException {\n constructor(message = messages.InvalidAccessError) {\n super(message, \"InvalidAccessError\");\n }\n}\nexports.InvalidAccessError = InvalidAccessError;\nclass InvalidStateError extends DOMException {\n constructor(message = messages.InvalidStateError) {\n super(message, \"InvalidStateError\");\n }\n}\nexports.InvalidStateError = InvalidStateError;\nclass NotFoundError extends DOMException {\n constructor(message = messages.NotFoundError) {\n super(message, \"NotFoundError\");\n }\n}\nexports.NotFoundError = NotFoundError;\nclass ReadOnlyError extends DOMException {\n constructor(message = messages.ReadOnlyError) {\n super(message, \"ReadOnlyError\");\n }\n}\nexports.ReadOnlyError = ReadOnlyError;\nclass TransactionInactiveError extends DOMException {\n constructor(message = messages.TransactionInactiveError) {\n super(message, \"TransactionInactiveError\");\n }\n}\nexports.TransactionInactiveError = TransactionInactiveError;\nclass VersionError extends DOMException {\n constructor(message = messages.VersionError) {\n super(message, \"VersionError\");\n }\n}\nexports.VersionError = VersionError;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _errors = require(\"./errors.js\");\n// https://w3c.github.io/IndexedDB/#convert-value-to-key\nconst valueToKey = (input, seen) => {\n if (typeof input === \"number\") {\n if (isNaN(input)) {\n throw new _errors.DataError();\n }\n return input;\n } else if (Object.prototype.toString.call(input) === \"[object Date]\") {\n const ms = input.valueOf();\n if (isNaN(ms)) {\n throw new _errors.DataError();\n }\n return new Date(ms);\n } else if (typeof input === \"string\") {\n return input;\n } else if (input instanceof ArrayBuffer || typeof SharedArrayBuffer !== \"undefined\" && input instanceof SharedArrayBuffer || typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView && ArrayBuffer.isView(input)) {\n let arrayBuffer;\n let offset = 0;\n let length = 0;\n if (input instanceof ArrayBuffer || typeof SharedArrayBuffer !== \"undefined\" && input instanceof SharedArrayBuffer) {\n arrayBuffer = input;\n length = input.byteLength;\n } else {\n arrayBuffer = input.buffer;\n offset = input.byteOffset;\n length = input.byteLength;\n }\n if (arrayBuffer.detached) {\n return new ArrayBuffer(0);\n }\n return arrayBuffer.slice(offset, offset + length);\n } else if (Array.isArray(input)) {\n if (seen === undefined) {\n seen = new Set();\n } else if (seen.has(input)) {\n throw new _errors.DataError();\n }\n seen.add(input);\n const keys = [];\n for (let i = 0; i < input.length; i++) {\n const hop = Object.hasOwn(input, i);\n if (!hop) {\n throw new _errors.DataError();\n }\n const entry = input[i];\n const key = valueToKey(entry, seen);\n keys.push(key);\n }\n return keys;\n } else {\n throw new _errors.DataError();\n }\n};\nvar _default = exports.default = valueToKey;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _errors = require(\"./errors.js\");\nvar _valueToKey = _interopRequireDefault(require(\"./valueToKey.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst getType = x => {\n if (typeof x === \"number\") {\n return \"Number\";\n }\n if (Object.prototype.toString.call(x) === \"[object Date]\") {\n return \"Date\";\n }\n if (Array.isArray(x)) {\n return \"Array\";\n }\n if (typeof x === \"string\") {\n return \"String\";\n }\n if (x instanceof ArrayBuffer) {\n return \"Binary\";\n }\n throw new _errors.DataError();\n};\n\n// https://w3c.github.io/IndexedDB/#compare-two-keys\nconst cmp = (first, second) => {\n if (second === undefined) {\n throw new TypeError();\n }\n first = (0, _valueToKey.default)(first);\n second = (0, _valueToKey.default)(second);\n const t1 = getType(first);\n const t2 = getType(second);\n if (t1 !== t2) {\n if (t1 === \"Array\") {\n return 1;\n }\n if (t1 === \"Binary\" && (t2 === \"String\" || t2 === \"Date\" || t2 === \"Number\")) {\n return 1;\n }\n if (t1 === \"String\" && (t2 === \"Date\" || t2 === \"Number\")) {\n return 1;\n }\n if (t1 === \"Date\" && t2 === \"Number\") {\n return 1;\n }\n return -1;\n }\n if (t1 === \"Binary\") {\n first = new Uint8Array(first);\n second = new Uint8Array(second);\n }\n if (t1 === \"Array\" || t1 === \"Binary\") {\n const length = Math.min(first.length, second.length);\n for (let i = 0; i < length; i++) {\n const result = cmp(first[i], second[i]);\n if (result !== 0) {\n return result;\n }\n }\n if (first.length > second.length) {\n return 1;\n }\n if (first.length < second.length) {\n return -1;\n }\n return 0;\n }\n if (t1 === \"Date\") {\n if (first.getTime() === second.getTime()) {\n return 0;\n }\n } else {\n if (first === second) {\n return 0;\n }\n }\n return first > second ? 1 : -1;\n};\nvar _default = exports.default = cmp;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _cmp = _interopRequireDefault(require(\"./lib/cmp.js\"));\nvar _errors = require(\"./lib/errors.js\");\nvar _valueToKey = _interopRequireDefault(require(\"./lib/valueToKey.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#range-concept\nclass FDBKeyRange {\n static only(value) {\n if (arguments.length === 0) {\n throw new TypeError();\n }\n value = (0, _valueToKey.default)(value);\n return new FDBKeyRange(value, value, false, false);\n }\n static lowerBound(lower, open = false) {\n if (arguments.length === 0) {\n throw new TypeError();\n }\n lower = (0, _valueToKey.default)(lower);\n return new FDBKeyRange(lower, undefined, open, true);\n }\n static upperBound(upper, open = false) {\n if (arguments.length === 0) {\n throw new TypeError();\n }\n upper = (0, _valueToKey.default)(upper);\n return new FDBKeyRange(undefined, upper, true, open);\n }\n static bound(lower, upper, lowerOpen = false, upperOpen = false) {\n if (arguments.length < 2) {\n throw new TypeError();\n }\n const cmpResult = (0, _cmp.default)(lower, upper);\n if (cmpResult === 1 || cmpResult === 0 && (lowerOpen || upperOpen)) {\n throw new _errors.DataError();\n }\n lower = (0, _valueToKey.default)(lower);\n upper = (0, _valueToKey.default)(upper);\n return new FDBKeyRange(lower, upper, lowerOpen, upperOpen);\n }\n constructor(lower, upper, lowerOpen, upperOpen) {\n this.lower = lower;\n this.upper = upper;\n this.lowerOpen = lowerOpen;\n this.upperOpen = upperOpen;\n }\n\n // https://w3c.github.io/IndexedDB/#dom-idbkeyrange-includes\n includes(key) {\n if (arguments.length === 0) {\n throw new TypeError();\n }\n key = (0, _valueToKey.default)(key);\n if (this.lower !== undefined) {\n const cmpResult = (0, _cmp.default)(this.lower, key);\n if (cmpResult === 1 || cmpResult === 0 && this.lowerOpen) {\n return false;\n }\n }\n if (this.upper !== undefined) {\n const cmpResult = (0, _cmp.default)(this.upper, key);\n if (cmpResult === -1 || cmpResult === 0 && this.upperOpen) {\n return false;\n }\n }\n return true;\n }\n toString() {\n return \"[object IDBKeyRange]\";\n }\n}\nvar _default = exports.default = FDBKeyRange;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _valueToKey = _interopRequireDefault(require(\"./valueToKey.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-extracting-a-key-from-a-value-using-a-key-path\nconst extractKey = (keyPath, value) => {\n if (Array.isArray(keyPath)) {\n const result = [];\n for (let item of keyPath) {\n // This doesn't make sense to me based on the spec, but it is needed to pass the W3C KeyPath tests (see same\n // comment in validateKeyPath)\n if (item !== undefined && item !== null && typeof item !== \"string\" && item.toString) {\n item = item.toString();\n }\n const key = extractKey(item, value).key;\n result.push((0, _valueToKey.default)(key));\n }\n return {\n type: \"found\",\n key: result\n };\n }\n if (keyPath === \"\") {\n return {\n type: \"found\",\n key: value\n };\n }\n let remainingKeyPath = keyPath;\n let object = value;\n while (remainingKeyPath !== null) {\n let identifier;\n const i = remainingKeyPath.indexOf(\".\");\n if (i >= 0) {\n identifier = remainingKeyPath.slice(0, i);\n remainingKeyPath = remainingKeyPath.slice(i + 1);\n } else {\n identifier = remainingKeyPath;\n remainingKeyPath = null;\n }\n if (object === undefined || object === null || !Object.hasOwn(object, identifier)) {\n return {\n type: \"notFound\"\n };\n }\n object = object[identifier];\n }\n return {\n type: \"found\",\n key: object\n };\n};\nvar _default = exports.default = extractKey;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _FDBKeyRange = _interopRequireDefault(require(\"./FDBKeyRange.js\"));\nvar _FDBObjectStore = _interopRequireDefault(require(\"./FDBObjectStore.js\"));\nvar _cmp = _interopRequireDefault(require(\"./lib/cmp.js\"));\nvar _errors = require(\"./lib/errors.js\");\nvar _extractKey = _interopRequireDefault(require(\"./lib/extractKey.js\"));\nvar _valueToKey = _interopRequireDefault(require(\"./lib/valueToKey.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst getEffectiveObjectStore = cursor => {\n if (cursor.source instanceof _FDBObjectStore.default) {\n return cursor.source;\n }\n return cursor.source.objectStore;\n};\n\n// This takes a key range, a list of lower bounds, and a list of upper bounds and combines them all into a single key\n// range. It does not handle gt/gte distinctions, because it doesn't really matter much anyway, since for next/prev\n// cursor iteration it'd also have to look at values to be precise, which would be complicated. This should get us 99%\n// of the way there.\nconst makeKeyRange = (range, lowers, uppers) => {\n // Start with bounds from range\n let lower = range !== undefined ? range.lower : undefined;\n let upper = range !== undefined ? range.upper : undefined;\n\n // Augment with values from lowers and uppers\n for (const lowerTemp of lowers) {\n if (lowerTemp === undefined) {\n continue;\n }\n if (lower === undefined || (0, _cmp.default)(lower, lowerTemp) === 1) {\n lower = lowerTemp;\n }\n }\n for (const upperTemp of uppers) {\n if (upperTemp === undefined) {\n continue;\n }\n if (upper === undefined || (0, _cmp.default)(upper, upperTemp) === -1) {\n upper = upperTemp;\n }\n }\n if (lower !== undefined && upper !== undefined) {\n return _FDBKeyRange.default.bound(lower, upper);\n }\n if (lower !== undefined) {\n return _FDBKeyRange.default.lowerBound(lower);\n }\n if (upper !== undefined) {\n return _FDBKeyRange.default.upperBound(upper);\n }\n};\n\n// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#cursor\nclass FDBCursor {\n _gotValue = false;\n _position = undefined; // Key of previously returned record\n _objectStorePosition = undefined;\n _keyOnly = false;\n _key = undefined;\n _primaryKey = undefined;\n constructor(source, range, direction = \"next\", request, keyOnly = false) {\n this._range = range;\n this._source = source;\n this._direction = direction;\n this._request = request;\n this._keyOnly = keyOnly;\n }\n\n // Read only properties\n get source() {\n return this._source;\n }\n set source(val) {\n /* For babel */\n }\n get request() {\n return this._request;\n }\n set request(val) {\n /* For babel */\n }\n get direction() {\n return this._direction;\n }\n set direction(val) {\n /* For babel */\n }\n get key() {\n return this._key;\n }\n set key(val) {\n /* For babel */\n }\n get primaryKey() {\n return this._primaryKey;\n }\n set primaryKey(val) {\n /* For babel */\n }\n\n // https://w3c.github.io/IndexedDB/#iterate-a-cursor\n _iterate(key, primaryKey) {\n const sourceIsObjectStore = this.source instanceof _FDBObjectStore.default;\n\n // Can't use sourceIsObjectStore because TypeScript\n const records = this.source instanceof _FDBObjectStore.default ? this.source._rawObjectStore.records : this.source._rawIndex.records;\n let foundRecord;\n if (this.direction === \"next\") {\n const range = makeKeyRange(this._range, [key, this._position], []);\n for (const record of records.values(range)) {\n const cmpResultKey = key !== undefined ? (0, _cmp.default)(record.key, key) : undefined;\n const cmpResultPosition = this._position !== undefined ? (0, _cmp.default)(record.key, this._position) : undefined;\n if (key !== undefined) {\n if (cmpResultKey === -1) {\n continue;\n }\n }\n if (primaryKey !== undefined) {\n if (cmpResultKey === -1) {\n continue;\n }\n const cmpResultPrimaryKey = (0, _cmp.default)(record.value, primaryKey);\n if (cmpResultKey === 0 && cmpResultPrimaryKey === -1) {\n continue;\n }\n }\n if (this._position !== undefined && sourceIsObjectStore) {\n if (cmpResultPosition !== 1) {\n continue;\n }\n }\n if (this._position !== undefined && !sourceIsObjectStore) {\n if (cmpResultPosition === -1) {\n continue;\n }\n if (cmpResultPosition === 0 && (0, _cmp.default)(record.value, this._objectStorePosition) !== 1) {\n continue;\n }\n }\n if (this._range !== undefined) {\n if (!this._range.includes(record.key)) {\n continue;\n }\n }\n foundRecord = record;\n break;\n }\n } else if (this.direction === \"nextunique\") {\n // This could be done without iterating, if the range was defined slightly better (to handle gt/gte cases).\n // But the performance difference should be small, and that wouldn't work anyway for directions where the\n // value needs to be used (like next and prev).\n const range = makeKeyRange(this._range, [key, this._position], []);\n for (const record of records.values(range)) {\n if (key !== undefined) {\n if ((0, _cmp.default)(record.key, key) === -1) {\n continue;\n }\n }\n if (this._position !== undefined) {\n if ((0, _cmp.default)(record.key, this._position) !== 1) {\n continue;\n }\n }\n if (this._range !== undefined) {\n if (!this._range.includes(record.key)) {\n continue;\n }\n }\n foundRecord = record;\n break;\n }\n } else if (this.direction === \"prev\") {\n const range = makeKeyRange(this._range, [], [key, this._position]);\n for (const record of records.values(range, \"prev\")) {\n const cmpResultKey = key !== undefined ? (0, _cmp.default)(record.key, key) : undefined;\n const cmpResultPosition = this._position !== undefined ? (0, _cmp.default)(record.key, this._position) : undefined;\n if (key !== undefined) {\n if (cmpResultKey === 1) {\n continue;\n }\n }\n if (primaryKey !== undefined) {\n if (cmpResultKey === 1) {\n continue;\n }\n const cmpResultPrimaryKey = (0, _cmp.default)(record.value, primaryKey);\n if (cmpResultKey === 0 && cmpResultPrimaryKey === 1) {\n continue;\n }\n }\n if (this._position !== undefined && sourceIsObjectStore) {\n if (cmpResultPosition !== -1) {\n continue;\n }\n }\n if (this._position !== undefined && !sourceIsObjectStore) {\n if (cmpResultPosition === 1) {\n continue;\n }\n if (cmpResultPosition === 0 && (0, _cmp.default)(record.value, this._objectStorePosition) !== -1) {\n continue;\n }\n }\n if (this._range !== undefined) {\n if (!this._range.includes(record.key)) {\n continue;\n }\n }\n foundRecord = record;\n break;\n }\n } else if (this.direction === \"prevunique\") {\n let tempRecord;\n const range = makeKeyRange(this._range, [], [key, this._position]);\n for (const record of records.values(range, \"prev\")) {\n if (key !== undefined) {\n if ((0, _cmp.default)(record.key, key) === 1) {\n continue;\n }\n }\n if (this._position !== undefined) {\n if ((0, _cmp.default)(record.key, this._position) !== -1) {\n continue;\n }\n }\n if (this._range !== undefined) {\n if (!this._range.includes(record.key)) {\n continue;\n }\n }\n tempRecord = record;\n break;\n }\n if (tempRecord) {\n foundRecord = records.get(tempRecord.key);\n }\n }\n let result;\n if (!foundRecord) {\n this._key = undefined;\n if (!sourceIsObjectStore) {\n this._objectStorePosition = undefined;\n }\n\n // \"this instanceof FDBCursorWithValue\" would be better and not require (this as any), but causes runtime\n // error due to circular dependency.\n if (!this._keyOnly && this.toString() === \"[object IDBCursorWithValue]\") {\n this.value = undefined;\n }\n result = null;\n } else {\n this._position = foundRecord.key;\n if (!sourceIsObjectStore) {\n this._objectStorePosition = foundRecord.value;\n }\n this._key = foundRecord.key;\n if (sourceIsObjectStore) {\n this._primaryKey = structuredClone(foundRecord.key);\n if (!this._keyOnly && this.toString() === \"[object IDBCursorWithValue]\") {\n this.value = structuredClone(foundRecord.value);\n }\n } else {\n this._primaryKey = structuredClone(foundRecord.value);\n if (!this._keyOnly && this.toString() === \"[object IDBCursorWithValue]\") {\n if (this.source instanceof _FDBObjectStore.default) {\n // Can't use sourceIsObjectStore because TypeScript\n throw new Error(\"This should never happen\");\n }\n const value = this.source.objectStore._rawObjectStore.getValue(foundRecord.value);\n this.value = structuredClone(value);\n }\n }\n this._gotValue = true;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n result = this;\n }\n return result;\n }\n\n // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-update-IDBRequest-any-value\n update(value) {\n if (value === undefined) {\n throw new TypeError();\n }\n const effectiveObjectStore = getEffectiveObjectStore(this);\n const effectiveKey = Object.hasOwn(this.source, \"_rawIndex\") ? this.primaryKey : this._position;\n const transaction = effectiveObjectStore.transaction;\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (transaction.mode === \"readonly\") {\n throw new _errors.ReadOnlyError();\n }\n if (effectiveObjectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!(this.source instanceof _FDBObjectStore.default) && this.source._rawIndex.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!this._gotValue || !Object.hasOwn(this, \"value\")) {\n throw new _errors.InvalidStateError();\n }\n const clone = structuredClone(value);\n if (effectiveObjectStore.keyPath !== null) {\n let tempKey;\n try {\n tempKey = (0, _extractKey.default)(effectiveObjectStore.keyPath, clone).key;\n } catch (err) {\n /* Handled immediately below */\n }\n if ((0, _cmp.default)(tempKey, effectiveKey) !== 0) {\n throw new _errors.DataError();\n }\n }\n const record = {\n key: effectiveKey,\n value: clone\n };\n return transaction._execRequestAsync({\n operation: effectiveObjectStore._rawObjectStore.storeRecord.bind(effectiveObjectStore._rawObjectStore, record, false, transaction._rollbackLog),\n source: this\n });\n }\n\n // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-advance-void-unsigned-long-count\n advance(count) {\n if (!Number.isInteger(count) || count <= 0) {\n throw new TypeError();\n }\n const effectiveObjectStore = getEffectiveObjectStore(this);\n const transaction = effectiveObjectStore.transaction;\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (effectiveObjectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!(this.source instanceof _FDBObjectStore.default) && this.source._rawIndex.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!this._gotValue) {\n throw new _errors.InvalidStateError();\n }\n if (this._request) {\n this._request.readyState = \"pending\";\n }\n transaction._execRequestAsync({\n operation: () => {\n let result;\n for (let i = 0; i < count; i++) {\n result = this._iterate();\n\n // Not sure why this is needed\n if (!result) {\n break;\n }\n }\n return result;\n },\n request: this._request,\n source: this.source\n });\n this._gotValue = false;\n }\n\n // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-continue-void-any-key\n continue(key) {\n const effectiveObjectStore = getEffectiveObjectStore(this);\n const transaction = effectiveObjectStore.transaction;\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (effectiveObjectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!(this.source instanceof _FDBObjectStore.default) && this.source._rawIndex.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!this._gotValue) {\n throw new _errors.InvalidStateError();\n }\n if (key !== undefined) {\n key = (0, _valueToKey.default)(key);\n const cmpResult = (0, _cmp.default)(key, this._position);\n if (cmpResult <= 0 && (this.direction === \"next\" || this.direction === \"nextunique\") || cmpResult >= 0 && (this.direction === \"prev\" || this.direction === \"prevunique\")) {\n throw new _errors.DataError();\n }\n }\n if (this._request) {\n this._request.readyState = \"pending\";\n }\n transaction._execRequestAsync({\n operation: this._iterate.bind(this, key),\n request: this._request,\n source: this.source\n });\n this._gotValue = false;\n }\n\n // hthttps://w3c.github.io/IndexedDB/#dom-idbcursor-continueprimarykey\n continuePrimaryKey(key, primaryKey) {\n const effectiveObjectStore = getEffectiveObjectStore(this);\n const transaction = effectiveObjectStore.transaction;\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (effectiveObjectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!(this.source instanceof _FDBObjectStore.default) && this.source._rawIndex.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (this.source instanceof _FDBObjectStore.default || this.direction !== \"next\" && this.direction !== \"prev\") {\n throw new _errors.InvalidAccessError();\n }\n if (!this._gotValue) {\n throw new _errors.InvalidStateError();\n }\n\n // Not sure about this\n if (key === undefined || primaryKey === undefined) {\n throw new _errors.DataError();\n }\n key = (0, _valueToKey.default)(key);\n const cmpResult = (0, _cmp.default)(key, this._position);\n if (cmpResult === -1 && this.direction === \"next\" || cmpResult === 1 && this.direction === \"prev\") {\n throw new _errors.DataError();\n }\n const cmpResult2 = (0, _cmp.default)(primaryKey, this._objectStorePosition);\n if (cmpResult === 0) {\n if (cmpResult2 <= 0 && this.direction === \"next\" || cmpResult2 >= 0 && this.direction === \"prev\") {\n throw new _errors.DataError();\n }\n }\n if (this._request) {\n this._request.readyState = \"pending\";\n }\n transaction._execRequestAsync({\n operation: this._iterate.bind(this, key, primaryKey),\n request: this._request,\n source: this.source\n });\n this._gotValue = false;\n }\n delete() {\n const effectiveObjectStore = getEffectiveObjectStore(this);\n const effectiveKey = Object.hasOwn(this.source, \"_rawIndex\") ? this.primaryKey : this._position;\n const transaction = effectiveObjectStore.transaction;\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (transaction.mode === \"readonly\") {\n throw new _errors.ReadOnlyError();\n }\n if (effectiveObjectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!(this.source instanceof _FDBObjectStore.default) && this.source._rawIndex.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (!this._gotValue || !Object.hasOwn(this, \"value\")) {\n throw new _errors.InvalidStateError();\n }\n return transaction._execRequestAsync({\n operation: effectiveObjectStore._rawObjectStore.deleteRecord.bind(effectiveObjectStore._rawObjectStore, effectiveKey, transaction._rollbackLog),\n source: this\n });\n }\n toString() {\n return \"[object IDBCursor]\";\n }\n}\nvar _default = exports.default = FDBCursor;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _FDBCursor = _interopRequireDefault(require(\"./FDBCursor.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nclass FDBCursorWithValue extends _FDBCursor.default {\n value = undefined;\n constructor(source, range, direction, request) {\n super(source, range, direction, request);\n }\n toString() {\n return \"[object IDBCursorWithValue]\";\n }\n}\nvar _default = exports.default = FDBCursorWithValue;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _errors = require(\"./errors.js\");\nconst stopped = (event, listener) => {\n return event.immediatePropagationStopped || event.eventPhase === event.CAPTURING_PHASE && listener.capture === false || event.eventPhase === event.BUBBLING_PHASE && listener.capture === true;\n};\n\n// http://www.w3.org/TR/dom/#concept-event-listener-invoke\nconst invokeEventListeners = (event, obj) => {\n event.currentTarget = obj;\n\n // The callback might cause obj.listeners to mutate as we traverse it.\n // Take a copy of the array so that nothing sneaks in and we don't lose\n // our place.\n for (const listener of obj.listeners.slice()) {\n if (event.type !== listener.type || stopped(event, listener)) {\n continue;\n }\n\n // @ts-ignore\n listener.callback.call(event.currentTarget, event);\n }\n const typeToProp = {\n abort: \"onabort\",\n blocked: \"onblocked\",\n complete: \"oncomplete\",\n error: \"onerror\",\n success: \"onsuccess\",\n upgradeneeded: \"onupgradeneeded\",\n versionchange: \"onversionchange\"\n };\n const prop = typeToProp[event.type];\n if (prop === undefined) {\n throw new Error(`Unknown event type: \"${event.type}\"`);\n }\n const callback = event.currentTarget[prop];\n if (callback) {\n const listener = {\n callback,\n capture: false,\n type: event.type\n };\n if (!stopped(event, listener)) {\n // @ts-ignore\n listener.callback.call(event.currentTarget, event);\n }\n }\n};\nclass FakeEventTarget {\n listeners = [];\n\n // These will be overridden in individual subclasses and made not readonly\n\n addEventListener(type, callback, capture = false) {\n this.listeners.push({\n callback,\n capture,\n type\n });\n }\n removeEventListener(type, callback, capture = false) {\n const i = this.listeners.findIndex(listener => {\n return listener.type === type && listener.callback === callback && listener.capture === capture;\n });\n this.listeners.splice(i, 1);\n }\n\n // http://www.w3.org/TR/dom/#dispatching-events\n dispatchEvent(event) {\n if (event.dispatched || !event.initialized) {\n throw new _errors.InvalidStateError(\"The object is in an invalid state.\");\n }\n event.isTrusted = false;\n event.dispatched = true;\n event.target = this;\n // NOT SURE WHEN THIS SHOULD BE SET event.eventPath = [];\n\n event.eventPhase = event.CAPTURING_PHASE;\n for (const obj of event.eventPath) {\n if (!event.propagationStopped) {\n invokeEventListeners(event, obj);\n }\n }\n event.eventPhase = event.AT_TARGET;\n if (!event.propagationStopped) {\n invokeEventListeners(event, event.target);\n }\n if (event.bubbles) {\n event.eventPath.reverse();\n event.eventPhase = event.BUBBLING_PHASE;\n for (const obj of event.eventPath) {\n if (!event.propagationStopped) {\n invokeEventListeners(event, obj);\n }\n }\n }\n event.dispatched = false;\n event.eventPhase = event.NONE;\n event.currentTarget = null;\n if (event.canceled) {\n return false;\n }\n return true;\n }\n}\nvar _default = exports.default = FakeEventTarget;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _errors = require(\"./lib/errors.js\");\nvar _FakeEventTarget = _interopRequireDefault(require(\"./lib/FakeEventTarget.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nclass FDBRequest extends _FakeEventTarget.default {\n _result = null;\n _error = null;\n source = null;\n transaction = null;\n readyState = \"pending\";\n onsuccess = null;\n onerror = null;\n get error() {\n if (this.readyState === \"pending\") {\n throw new _errors.InvalidStateError();\n }\n return this._error;\n }\n set error(value) {\n this._error = value;\n }\n get result() {\n if (this.readyState === \"pending\") {\n throw new _errors.InvalidStateError();\n }\n return this._result;\n }\n set result(value) {\n this._result = value;\n }\n toString() {\n return \"[object IDBRequest]\";\n }\n}\nvar _default = exports.default = FDBRequest;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n// https://heycam.github.io/webidl/#EnforceRange\n\nconst enforceRange = (num, type) => {\n const min = 0;\n const max = type === \"unsigned long\" ? 4294967295 : 9007199254740991;\n if (isNaN(num) || num < min || num > max) {\n throw new TypeError();\n }\n if (num >= 0) {\n return Math.floor(num);\n }\n};\nvar _default = exports.default = enforceRange;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nclass FakeDOMStringList extends Array {\n contains(value) {\n for (const value2 of this) {\n if (value === value2) {\n return true;\n }\n }\n return false;\n }\n item(i) {\n if (i < 0 || i >= this.length) {\n return null;\n }\n return this[i];\n }\n\n // Used internally, should not be used by others. I could maybe get rid of these and replace rather than mutate, but too lazy to check the spec.\n _push(...values) {\n return Array.prototype.push.call(this, ...values);\n }\n _sort(...values) {\n return Array.prototype.sort.call(this, ...values);\n }\n}\n\n// Would be nice to remove these properties to fix https://github.com/dumbmatter/fakeIndexedDB/issues/66 but for some reason it breaks Dexie - see test/dexie.js and FakeDOMStringList tests\n/*\n// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\nconst arrayPropertiesToDelete = [\"from\", \"isArray\", \"of\"];\nconst arrayMethodsToDelete = [\n \"at\",\n \"concat\",\n \"copyWithin\",\n \"entries\",\n \"every\",\n \"fill\",\n \"filter\",\n \"find\",\n \"findIndex\",\n \"flat\",\n \"flatMap\",\n \"forEach\",\n \"includes\",\n \"indexOf\",\n \"join\",\n \"keys\",\n \"lastIndexOf\",\n \"map\",\n \"pop\",\n \"push\",\n \"reduce\",\n \"reduceRight\",\n \"reverse\",\n \"shift\",\n \"slice\",\n \"some\",\n \"sort\",\n \"splice\",\n \"unshift\",\n \"values\",\n];\n\n// Set to undefined rather than delete, so it doesn't go up the chain to Array. Not perfect, but good enough?\nfor (const property of arrayPropertiesToDelete) {\n (FakeDOMStringList as any)[property] = undefined;\n}\nfor (const property of arrayMethodsToDelete) {\n (FakeDOMStringList as any).prototype[property] = undefined;\n}\n*/\nvar _default = exports.default = FakeDOMStringList;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _FDBKeyRange = _interopRequireDefault(require(\"../FDBKeyRange.js\"));\nvar _errors = require(\"./errors.js\");\nvar _valueToKey = _interopRequireDefault(require(\"./valueToKey.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// http://w3c.github.io/IndexedDB/#convert-a-value-to-a-key-range\nconst valueToKeyRange = (value, nullDisallowedFlag = false) => {\n if (value instanceof _FDBKeyRange.default) {\n return value;\n }\n if (value === null || value === undefined) {\n if (nullDisallowedFlag) {\n throw new _errors.DataError();\n }\n return new _FDBKeyRange.default(undefined, undefined, false, false);\n }\n const key = (0, _valueToKey.default)(value);\n return _FDBKeyRange.default.only(key);\n};\nvar _default = exports.default = valueToKeyRange;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _FDBCursor = _interopRequireDefault(require(\"./FDBCursor.js\"));\nvar _FDBCursorWithValue = _interopRequireDefault(require(\"./FDBCursorWithValue.js\"));\nvar _FDBKeyRange = _interopRequireDefault(require(\"./FDBKeyRange.js\"));\nvar _FDBRequest = _interopRequireDefault(require(\"./FDBRequest.js\"));\nvar _enforceRange = _interopRequireDefault(require(\"./lib/enforceRange.js\"));\nvar _errors = require(\"./lib/errors.js\");\nvar _FakeDOMStringList = _interopRequireDefault(require(\"./lib/FakeDOMStringList.js\"));\nvar _valueToKey = _interopRequireDefault(require(\"./lib/valueToKey.js\"));\nvar _valueToKeyRange = _interopRequireDefault(require(\"./lib/valueToKeyRange.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst confirmActiveTransaction = index => {\n if (index._rawIndex.deleted || index.objectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n if (index.objectStore.transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n};\n\n// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#idl-def-IDBIndex\nclass FDBIndex {\n constructor(objectStore, rawIndex) {\n this._rawIndex = rawIndex;\n this._name = rawIndex.name;\n this.objectStore = objectStore;\n this.keyPath = rawIndex.keyPath;\n this.multiEntry = rawIndex.multiEntry;\n this.unique = rawIndex.unique;\n }\n get name() {\n return this._name;\n }\n\n // https://w3c.github.io/IndexedDB/#dom-idbindex-name\n set name(name) {\n const transaction = this.objectStore.transaction;\n if (!transaction.db._runningVersionchangeTransaction) {\n throw new _errors.InvalidStateError();\n }\n if (transaction._state !== \"active\") {\n throw new _errors.TransactionInactiveError();\n }\n if (this._rawIndex.deleted || this.objectStore._rawObjectStore.deleted) {\n throw new _errors.InvalidStateError();\n }\n name = String(name);\n if (name === this._name) {\n return;\n }\n if (this.objectStore.indexNames.contains(name)) {\n throw new _errors.ConstraintError();\n }\n const oldName = this._name;\n const oldIndexNames = [...this.objectStore.indexNames];\n this._name = name;\n this._rawIndex.name = name;\n this.objectStore._indexesCache.delete(oldName);\n this.objectStore._indexesCache.set(name, this);\n this.objectStore._rawObjectStore.rawIndexes.delete(oldName);\n this.objectStore._rawObjectStore.rawIndexes.set(name, this._rawIndex);\n this.objectStore.indexNames = new _FakeDOMStringList.default(...Array.from(this.objectStore._rawObjectStore.rawIndexes.keys()).filter(indexName => {\n const index = this.objectStore._rawObjectStore.rawIndexes.get(indexName);\n return index && !index.deleted;\n }).sort());\n transaction._rollbackLog.push(() => {\n this._name = oldName;\n this._rawIndex.name = oldName;\n this.objectStore._indexesCache.delete(name);\n this.objectStore._indexesCache.set(oldName, this);\n this.objectStore._rawObjectStore.rawIndexes.delete(name);\n this.objectStore._rawObjectStore.rawIndexes.set(oldName, this._rawIndex);\n this.objectStore.indexNames = new _FakeDOMStringList.default(...oldIndexNames);\n });\n }\n\n // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-openCursor-IDBRequest-any-range-IDBCursorDirection-direction\n openCursor(range, direction) {\n confirmActiveTransaction(this);\n if (range === null) {\n range = undefined;\n }\n if (range !== undefined && !(range instanceof _FDBKeyRange.default)) {\n range = _FDBKeyRange.default.only((0, _valueToKey.default)(range));\n }\n const request = new _FDBRequest.default();\n request.source = this;\n request.transaction = this.objectStore.transaction;\n const cursor = new _FDBCursorWithValue.default(this, range, direction, request);\n return this.objectStore.transaction._execRequestAsync({\n operation: cursor._iterate.bind(cursor),\n request,\n source: this\n });\n }\n\n // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-openKeyCursor-IDBRequest-any-range-IDBCursorDirection-direction\n openKeyCursor(range, direction) {\n confirmActiveTransaction(this);\n if (range === null) {\n range = undefined;\n }\n if (range !== undefined && !(range instanceof _FDBKeyRange.default)) {\n range = _FDBKeyRange.default.only((0, _valueToKey.default)(range));\n }\n const request = new _FDBRequest.default();\n request.source = this;\n request.transaction = this.objectStore.transaction;\n const cursor = new _FDBCursor.default(this, range, direction, request, true);\n return this.objectStore.transaction._execRequestAsync({\n operation: cursor._iterate.bind(cursor),\n request,\n source: this\n });\n }\n get(key) {\n confirmActiveTransaction(thi