fake-indexeddb 4.0.0 → 4.0.2

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.
package/README.md CHANGED
@@ -89,11 +89,11 @@ As of version 4, fake-indexeddb includes TypeScript types. As you can see in typ
89
89
 
90
90
  ### Dexie and other IndexedDB API wrappers
91
91
 
92
- If you import `fake-indexeddb/auto` before calling `new Dexie()`, it should work:
92
+ If you import `fake-indexeddb/auto` before importing `dexie`, it should work:
93
93
 
94
94
  ```js
95
- import Dexie from "dexie";
96
95
  import "fake-indexeddb/auto";
96
+ import Dexie from "dexie";
97
97
 
98
98
  const db = new Dexie("MyDatabase");
99
99
  ```
@@ -118,20 +118,17 @@ To use it on all Jest tests without having to include it in each file, add the a
118
118
 
119
119
  ```json
120
120
  {
121
- ...
122
121
  "setupFiles": [
123
- "fake-indexeddb/auto.cjs"
122
+ "fake-indexeddb/auto"
124
123
  ]
125
124
  }
126
125
  ```
127
126
 
128
- That's "auto.cjs" rather than just "auto" to make sure it picks up the CommonJS version. Otherwise it would use the ESM version, which Jest does not support without [some extra configuration](https://jestjs.io/docs/ecmascript-modules).
129
-
130
127
  ### Wiping/resetting the indexedDB for a fresh state
131
128
 
132
129
  If you are keeping your tests completely isolated you might want to "reset" the state of the mocked indexedDB. You can do this by creating a new instance of `IDBFactory`, which lets you have a totally fresh start.
133
130
 
134
- ```
131
+ ```js
135
132
  import "fake-indexeddb/auto";
136
133
  import { IDBFactory } from "fake-indexeddb";
137
134
 
@@ -98,6 +98,14 @@ class FDBCursor {
98
98
  /* For babel */
99
99
  }
100
100
 
101
+ get request() {
102
+ return this._request;
103
+ }
104
+
105
+ set request(val) {
106
+ /* For babel */
107
+ }
108
+
101
109
  get direction() {
102
110
  return this._direction;
103
111
  }
@@ -83,6 +83,14 @@ class FDBCursor {
83
83
  /* For babel */
84
84
  }
85
85
 
86
+ get request() {
87
+ return this._request;
88
+ }
89
+
90
+ set request(val) {
91
+ /* For babel */
92
+ }
93
+
86
94
  get direction() {
87
95
  return this._direction;
88
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fake-indexeddb",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Fake IndexedDB: a pure JS in-memory implementation of the IndexedDB API",
5
5
  "homepage": "https://github.com/dumbmatter/fakeIndexedDB",
6
6
  "repository": {
@@ -25,6 +25,7 @@
25
25
  "module": "./build/esm/index.js",
26
26
  "exports": {
27
27
  ".": {
28
+ "types": "./types.d.ts",
28
29
  "import": "./build/esm/index.js",
29
30
  "require": "./build/cjs/index.js"
30
31
  },
@@ -32,7 +33,6 @@
32
33
  "import": "./auto/index.mjs",
33
34
  "require": "./auto/index.js"
34
35
  },
35
- "./auto.cjs": "./auto.cjs",
36
36
  "./lib/fakeIndexedDB": {
37
37
  "import": "./build/esm/fakeIndexedDB.js",
38
38
  "require": "./build/cjs/fakeIndexedDB.js"