fake-indexeddb 4.0.0-beta.3 → 4.0.0-beta.5

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,15 +1,15 @@
1
- const fakeIndexedDB = require("./build/cjs/fakeIndexedDB.js");
2
- const FDBCursor = require("./build/cjs/FDBCursor.js");
3
- const FDBCursorWithValue = require("./build/cjs/FDBCursorWithValue.js");
4
- const FDBDatabase = require("./build/cjs/FDBDatabase.js");
5
- const FDBFactory = require("./build/cjs/FDBFactory.js");
6
- const FDBIndex = require("./build/cjs/FDBIndex.js");
7
- const FDBKeyRange = require("./build/cjs/FDBKeyRange.js");
8
- const FDBObjectStore = require("./build/cjs/FDBObjectStore.js");
9
- const FDBOpenDBRequest = require("./build/cjs/FDBOpenDBRequest.js");
10
- const FDBRequest = require("./build/cjs/FDBRequest.js");
11
- const FDBTransaction = require("./build/cjs/FDBTransaction.js");
12
- const FDBVersionChangeEvent = require("./build/cjs/FDBVersionChangeEvent.js");
1
+ const fakeIndexedDB = require("../build/cjs/fakeIndexedDB.js");
2
+ const FDBCursor = require("../build/cjs/FDBCursor.js");
3
+ const FDBCursorWithValue = require("../build/cjs/FDBCursorWithValue.js");
4
+ const FDBDatabase = require("../build/cjs/FDBDatabase.js");
5
+ const FDBFactory = require("../build/cjs/FDBFactory.js");
6
+ const FDBIndex = require("../build/cjs/FDBIndex.js");
7
+ const FDBKeyRange = require("../build/cjs/FDBKeyRange.js");
8
+ const FDBObjectStore = require("../build/cjs/FDBObjectStore.js");
9
+ const FDBOpenDBRequest = require("../build/cjs/FDBOpenDBRequest.js");
10
+ const FDBRequest = require("../build/cjs/FDBRequest.js");
11
+ const FDBTransaction = require("../build/cjs/FDBTransaction.js");
12
+ const FDBVersionChangeEvent = require("../build/cjs/FDBVersionChangeEvent.js");
13
13
 
14
14
  // http://stackoverflow.com/a/33268326/786644 - works in browser, worker, and Node.js
15
15
  var globalVar =
@@ -1,15 +1,15 @@
1
- import fakeIndexedDB from "./build/esm/fakeIndexedDB.js";
2
- import FDBCursor from "./build/esm/FDBCursor.js";
3
- import FDBCursorWithValue from "./build/esm/FDBCursorWithValue.js";
4
- import FDBDatabase from "./build/esm/FDBDatabase.js";
5
- import FDBFactory from "./build/esm/FDBFactory.js";
6
- import FDBIndex from "./build/esm/FDBIndex.js";
7
- import FDBKeyRange from "./build/esm/FDBKeyRange.js";
8
- import FDBObjectStore from "./build/esm/FDBObjectStore.js";
9
- import FDBOpenDBRequest from "./build/esm/FDBOpenDBRequest.js";
10
- import FDBRequest from "./build/esm/FDBRequest.js";
11
- import FDBTransaction from "./build/esm/FDBTransaction.js";
12
- import FDBVersionChangeEvent from "./build/esm/FDBVersionChangeEvent.js";
1
+ import fakeIndexedDB from "../build/esm/fakeIndexedDB.js";
2
+ import FDBCursor from "../build/esm/FDBCursor.js";
3
+ import FDBCursorWithValue from "../build/esm/FDBCursorWithValue.js";
4
+ import FDBDatabase from "../build/esm/FDBDatabase.js";
5
+ import FDBFactory from "../build/esm/FDBFactory.js";
6
+ import FDBIndex from "../build/esm/FDBIndex.js";
7
+ import FDBKeyRange from "../build/esm/FDBKeyRange.js";
8
+ import FDBObjectStore from "../build/esm/FDBObjectStore.js";
9
+ import FDBOpenDBRequest from "../build/esm/FDBOpenDBRequest.js";
10
+ import FDBRequest from "../build/esm/FDBRequest.js";
11
+ import FDBTransaction from "../build/esm/FDBTransaction.js";
12
+ import FDBVersionChangeEvent from "../build/esm/FDBVersionChangeEvent.js";
13
13
 
14
14
  // http://stackoverflow.com/a/33268326/786644 - works in browser, worker, and Node.js
15
15
  var globalVar =
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -46,7 +46,7 @@ const extractKey = (keyPath, value) => {
46
46
  remainingKeyPath = null;
47
47
  }
48
48
 
49
- if (!object.hasOwnProperty(identifier)) {
49
+ if (object === undefined || object === null || !object.hasOwnProperty(identifier)) {
50
50
  return;
51
51
  }
52
52
 
@@ -14,9 +14,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
14
  // Built-in structuredClone arrived in Node 17, so we need to keep this file around as long as we support Node 16
15
15
  // @ts-expect-error
16
16
  const structuredCloneWrapper = input => {
17
- // @ts-expect-error
18
17
  if (typeof structuredClone !== "undefined") {
19
- // @ts-expect-error
20
18
  return structuredClone(input);
21
19
  }
22
20
 
@@ -36,7 +36,7 @@ const extractKey = (keyPath, value) => {
36
36
  remainingKeyPath = null;
37
37
  }
38
38
 
39
- if (!object.hasOwnProperty(identifier)) {
39
+ if (object === undefined || object === null || !object.hasOwnProperty(identifier)) {
40
40
  return;
41
41
  }
42
42
 
@@ -4,9 +4,7 @@ import realisticStructuredClone from "realistic-structured-clone";
4
4
  import { DataCloneError } from "./errors.js";
5
5
 
6
6
  const structuredCloneWrapper = input => {
7
- // @ts-expect-error
8
7
  if (typeof structuredClone !== "undefined") {
9
- // @ts-expect-error
10
8
  return structuredClone(input);
11
9
  }
12
10
 
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBCursor");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBCursorWithValue");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBDatabase");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBFactory");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBIndex");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBKeyRange");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBObjectStore");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBOpenDBRequest");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBRequest");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBTransaction");
@@ -0,0 +1 @@
1
+ module.exports = require("../build/cjs/FDBVersionChangeEvent");
package/lib/README.md ADDED
@@ -0,0 +1,5 @@
1
+ These are just for backwards compatibility with fake-indexeddb v3 and earlier.
2
+
3
+ The .js files are for things that don't understand the package.json exports field, such as Jest 27 and earlier.
4
+
5
+ The .d.ts files are here for the same reason, but are additionally used by things reading the package.json exports field too, since TypeScript 4.6 and earlier don't support specifying types in exports.
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fake-indexeddb",
3
- "version": "4.0.0-beta.3",
3
+ "version": "4.0.0-beta.5",
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": {
@@ -29,8 +29,8 @@
29
29
  "require": "./build/cjs/index.js"
30
30
  },
31
31
  "./auto": {
32
- "import": "./auto.js",
33
- "require": "./auto.cjs"
32
+ "import": "./auto/index.mjs",
33
+ "require": "./auto/index.js"
34
34
  },
35
35
  "./auto.cjs": "./auto.cjs",
36
36
  "./lib/fakeIndexedDB": {
@@ -82,9 +82,6 @@
82
82
  "require": "./build/cjs/FDBVersionChangeEvent.js"
83
83
  }
84
84
  },
85
- "engines": {
86
- "node": ">=12.0.0"
87
- },
88
85
  "types": "./types.d.ts",
89
86
  "scripts": {
90
87
  "build": "rm -rf build && yarn run build-esm && yarn run build-cjs",
@@ -104,39 +101,38 @@
104
101
  "author": "Jeremy Scheff <jdscheff@gmail.com> (http://dumbmatter.com/)",
105
102
  "license": "Apache-2.0",
106
103
  "files": [
107
- "auto.cjs",
104
+ "auto",
108
105
  "auto.d.ts",
109
- "auto.js",
110
106
  "build",
111
- "lib/*.d.ts",
107
+ "lib",
112
108
  "types.d.ts"
113
109
  ],
114
110
  "dependencies": {
115
- "realistic-structured-clone": "^2.0.1"
111
+ "realistic-structured-clone": "^3.0.0"
116
112
  },
117
113
  "devDependencies": {
118
- "@babel/cli": "^7.17.6",
119
- "@babel/core": "^7.17.7",
120
- "@babel/plugin-transform-modules-commonjs": "^7.17.7",
121
- "@babel/preset-env": "^7.16.11",
122
- "@babel/preset-typescript": "^7.16.7",
123
- "@types/mocha": "^9.1.0",
124
- "@types/node": "^17.0.21",
114
+ "@babel/cli": "^7.18.6",
115
+ "@babel/core": "^7.18.6",
116
+ "@babel/plugin-transform-modules-commonjs": "^7.18.6",
117
+ "@babel/preset-env": "^7.18.6",
118
+ "@babel/preset-typescript": "^7.18.6",
119
+ "@types/mocha": "^9.1.1",
120
+ "@types/node": "^18.0.0",
125
121
  "babel-plugin-add-module-exports": "^1.0.4",
126
122
  "babelify": "^10.0.0",
127
123
  "browserify": "^17.0.0",
128
- "core-js": "^3.21.1",
129
- "glob": "^7.2.0",
124
+ "core-js": "^3.23.3",
125
+ "glob": "^8.0.3",
130
126
  "husky": "^7.0.4",
131
- "jest": "^27.5.1",
132
- "lint-staged": "^12.3.6",
127
+ "jest": "^28.1.2",
128
+ "lint-staged": "^12.5.0",
133
129
  "mocha": "^9.2.2",
134
130
  "node-qunit-phantomjs": "^1.6.3",
135
- "prettier": "^2.6.0",
131
+ "prettier": "^2.7.1",
136
132
  "qunitjs": "^1.23.1",
137
133
  "tslint": "^6.1.3",
138
134
  "tslint-config-prettier": "^1.15.0",
139
- "typescript": "4.6.2"
135
+ "typescript": "4.7.4"
140
136
  },
141
137
  "lint-staged": {
142
138
  "*.{js,json,ts}": "prettier --write"