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

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.
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- // Subclass Array to get nice behaviors like destructuring, but delete various Array methods that don't exist on DOMStringList https://github.com/dumbmatter/fakeIndexedDB/issues/66#issuecomment-922407403
9
8
  class FakeDOMStringList extends Array {
10
9
  contains(value) {
11
10
  for (const value2 of this) {
@@ -34,19 +33,53 @@ class FakeDOMStringList extends Array {
34
33
  return Array.prototype.sort.call(this, ...values);
35
34
  }
36
35
 
37
- } // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
38
-
36
+ } // 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
39
37
 
38
+ /*
39
+ // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
40
40
  const arrayPropertiesToDelete = ["from", "isArray", "of"];
41
- const arrayMethodsToDelete = ["at", "concat", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "flat", "flatMap", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "unshift", "values"]; // Set to undefined rather than delete, so it doesn't go up the chain to Array. Not perfect, but good enough?
41
+ const arrayMethodsToDelete = [
42
+ "at",
43
+ "concat",
44
+ "copyWithin",
45
+ "entries",
46
+ "every",
47
+ "fill",
48
+ "filter",
49
+ "find",
50
+ "findIndex",
51
+ "flat",
52
+ "flatMap",
53
+ "forEach",
54
+ "includes",
55
+ "indexOf",
56
+ "join",
57
+ "keys",
58
+ "lastIndexOf",
59
+ "map",
60
+ "pop",
61
+ "push",
62
+ "reduce",
63
+ "reduceRight",
64
+ "reverse",
65
+ "shift",
66
+ "slice",
67
+ "some",
68
+ "sort",
69
+ "splice",
70
+ "unshift",
71
+ "values",
72
+ ];
42
73
 
74
+ // Set to undefined rather than delete, so it doesn't go up the chain to Array. Not perfect, but good enough?
43
75
  for (const property of arrayPropertiesToDelete) {
44
- FakeDOMStringList[property] = undefined;
76
+ (FakeDOMStringList as any)[property] = undefined;
45
77
  }
46
-
47
78
  for (const property of arrayMethodsToDelete) {
48
- FakeDOMStringList.prototype[property] = undefined;
79
+ (FakeDOMStringList as any).prototype[property] = undefined;
49
80
  }
81
+ */
82
+
50
83
 
51
84
  var _default = FakeDOMStringList;
52
85
  exports.default = _default;
@@ -1,4 +1,3 @@
1
- // Subclass Array to get nice behaviors like destructuring, but delete various Array methods that don't exist on DOMStringList https://github.com/dumbmatter/fakeIndexedDB/issues/66#issuecomment-922407403
2
1
  class FakeDOMStringList extends Array {
3
2
  contains(value) {
4
3
  for (const value2 of this) {
@@ -27,18 +26,52 @@ class FakeDOMStringList extends Array {
27
26
  return Array.prototype.sort.call(this, ...values);
28
27
  }
29
28
 
30
- } // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
31
-
29
+ } // 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
32
30
 
31
+ /*
32
+ // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
33
33
  const arrayPropertiesToDelete = ["from", "isArray", "of"];
34
- const arrayMethodsToDelete = ["at", "concat", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "flat", "flatMap", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "unshift", "values"]; // Set to undefined rather than delete, so it doesn't go up the chain to Array. Not perfect, but good enough?
34
+ const arrayMethodsToDelete = [
35
+ "at",
36
+ "concat",
37
+ "copyWithin",
38
+ "entries",
39
+ "every",
40
+ "fill",
41
+ "filter",
42
+ "find",
43
+ "findIndex",
44
+ "flat",
45
+ "flatMap",
46
+ "forEach",
47
+ "includes",
48
+ "indexOf",
49
+ "join",
50
+ "keys",
51
+ "lastIndexOf",
52
+ "map",
53
+ "pop",
54
+ "push",
55
+ "reduce",
56
+ "reduceRight",
57
+ "reverse",
58
+ "shift",
59
+ "slice",
60
+ "some",
61
+ "sort",
62
+ "splice",
63
+ "unshift",
64
+ "values",
65
+ ];
35
66
 
67
+ // Set to undefined rather than delete, so it doesn't go up the chain to Array. Not perfect, but good enough?
36
68
  for (const property of arrayPropertiesToDelete) {
37
- FakeDOMStringList[property] = undefined;
69
+ (FakeDOMStringList as any)[property] = undefined;
38
70
  }
39
-
40
71
  for (const property of arrayMethodsToDelete) {
41
- FakeDOMStringList.prototype[property] = undefined;
72
+ (FakeDOMStringList as any).prototype[property] = undefined;
42
73
  }
74
+ */
75
+
43
76
 
44
77
  export default FakeDOMStringList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fake-indexeddb",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.6",
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": {
@@ -95,7 +95,7 @@
95
95
  "build-qunit": "mkdir build/esm/test/indexedDBmock && cp src/test/indexedDBmock/* build/esm/test/indexedDBmock && browserify src/test/indexedDBmock/exports-qunit-bundle.js -o build/esm/test/indexedDBmock/exports-qunit-bundle.js -t [ babelify --presets [ @babel/preset-env ] ]",
96
96
  "test-qunit": "yarn run build-qunit && node-qunit-phantomjs build/esm/test/indexedDBmock/index.html",
97
97
  "test-w3c": "node src/test/web-platform-tests/run-all.js",
98
- "test": "rm -rf build && yarn run lint && yarn run build && yarn run test-jest && node test/test.js && yarn run test-w3c && yarn run test-mocha && yarn run test-qunit",
98
+ "test": "rm -rf build && yarn run lint && yarn run build && yarn run test-jest && node test/test.js && node test/dexie.js && yarn run test-w3c && yarn run test-mocha && yarn run test-qunit",
99
99
  "prepare": "husky install"
100
100
  },
101
101
  "author": "Jeremy Scheff <jdscheff@gmail.com> (http://dumbmatter.com/)",
@@ -122,6 +122,7 @@
122
122
  "babelify": "^10.0.0",
123
123
  "browserify": "^17.0.0",
124
124
  "core-js": "^3.23.3",
125
+ "dexie": "^3.2.2",
125
126
  "glob": "^8.0.3",
126
127
  "husky": "^7.0.4",
127
128
  "jest": "^28.1.2",