indexeddbshim 9.0.0 → 10.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indexeddbshim",
3
- "version": "9.0.0",
3
+ "version": "10.1.0",
4
4
  "author": "Parashuram <code@nparashuram.com>",
5
5
  "contributors": [
6
6
  "Brett Zamir"
@@ -51,14 +51,14 @@
51
51
  "w3c-old": "run-s clean-w3cOld coverage:w3cOld clean-w3cOld",
52
52
  "tests-polyfill": "run-s clean-polyfill coverage:fake coverage:mock coverage:w3cOld",
53
53
  "mocha": "run-s clean-mocha coverage:mocha clean-mocha",
54
- "rollup": "rollup -c",
55
- "coverage:fake": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@mochajs/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
56
- "coverage:mock": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@mochajs/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
57
- "coverage:w3cOld": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@mochajs/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
54
+ "rollup": "rollup -c --bundleConfigAsCjs",
55
+ "coverage:fake": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+fake --require source-map-support/register tests-polyfill/fakeIndexedDB/test-node.js",
56
+ "coverage:mock": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mock --require source-map-support/register tests-polyfill/indexedDBmock/test-node.js",
57
+ "coverage:w3cOld": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+w3c --require source-map-support/register tests-polyfill/w3c/test-node.js",
58
58
  "coverage:w3c": "NODE_OPTIONS=--max_old_space_size=4096 nyc --silent --no-clean npm run w3c-test-only",
59
59
  "test:w3c": "NODE_OPTIONS=--max_old_space_size=4096 node --experimental-worker test-support/node-idb-test",
60
60
  "w3c-test-only": "node --experimental-worker test-support/node-idb-test",
61
- "coverage:mocha": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@mochajs/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
61
+ "coverage:mocha": "nyc --silent --no-clean mocha --reporterOptions configFile=mocha-multi-reporters.json,cmrOutput=@es-joy/json-file-reporter+output+mocha --require source-map-support/register tests-mocha/test-node.js",
62
62
  "coverage-badge": "coveradge badges/coverage-badge",
63
63
  "coverage:report-only": "nyc report",
64
64
  "coverage:report": "run-s coverage:report-only",
@@ -129,78 +129,78 @@
129
129
  "last 3 Samsung versions"
130
130
  ],
131
131
  "engines": {
132
- "node": ">=12.0.0"
132
+ "node": ">=14.0.0"
133
133
  },
134
134
  "dependencies": {
135
135
  "eventtargeter": "0.8.0",
136
136
  "sync-promise": "git+https://github.com/brettz9/sync-promise.git#full-sync-missing-promise-features",
137
- "typeson": "6.1.0",
138
- "typeson-registry": "1.0.0-alpha.39",
137
+ "typeson": "7.0.2",
138
+ "typeson-registry": "3.0.0",
139
139
  "websql": "git+https://github.com/brettz9/node-websql.git#configurable-secure3"
140
140
  },
141
141
  "devDependencies": {
142
- "@babel/core": "^7.16.7",
143
- "@babel/preset-env": "^7.16.7",
142
+ "@babel/core": "^7.20.5",
143
+ "@babel/preset-env": "^7.20.2",
144
144
  "@brettz9/eslint-plugin": "^1.0.4",
145
145
  "@brettz9/node-static": "^0.1.1",
146
- "@mochajs/json-file-reporter": "^1.3.0",
147
- "@rollup/plugin-babel": "^5.3.0",
148
- "@rollup/plugin-commonjs": "^21.0.1",
149
- "@rollup/plugin-json": "^4.1.0",
150
- "@rollup/plugin-node-resolve": "^13.1.2",
151
- "@rollup/plugin-replace": "^3.0.1",
152
- "@unicode/unicode-13.0.0": "1.2.1",
146
+ "@es-joy/json-file-reporter": "^1.4.0",
147
+ "@rollup/plugin-babel": "^6.0.3",
148
+ "@rollup/plugin-commonjs": "^23.0.4",
149
+ "@rollup/plugin-json": "^5.0.2",
150
+ "@rollup/plugin-node-resolve": "^15.0.1",
151
+ "@rollup/plugin-replace": "^5.0.1",
152
+ "@rollup/plugin-terser": "^0.2.0",
153
+ "@unicode/unicode-13.0.0": "1.3.1",
153
154
  "babel-plugin-add-module-exports": "1.0.4",
154
- "bson": "^4.6.0",
155
- "builtin-modules": "^3.2.0",
156
- "canvas": "^2.8.0",
157
- "chai": "4.3.4",
155
+ "bson": "^4.7.0",
156
+ "builtin-modules": "^3.3.0",
157
+ "canvas": "^2.10.2",
158
+ "chai": "4.3.7",
158
159
  "chokidar-cli": "^3.0.0",
159
160
  "colors": "1.4.0",
160
161
  "copyfiles": "^2.4.1",
161
- "core-js-bundle": "^3.20.2",
162
- "coveradge": "^0.7.0",
162
+ "core-js-bundle": "^3.26.1",
163
+ "coveradge": "^0.8.2",
163
164
  "cyclonejs": "1.1.4",
164
- "delay-cli": "^1.1.0",
165
- "eslint": "^8.6.0",
166
- "eslint-config-ash-nazg": "^32.3.0",
167
- "eslint-config-standard": "^16.0.3",
165
+ "delay-cli": "^2.0.0",
166
+ "eslint": "^8.29.0",
167
+ "eslint-config-ash-nazg": "^34.6.0",
168
+ "eslint-config-standard": "^17.0.0",
168
169
  "eslint-plugin-array-func": "^3.1.7",
169
- "eslint-plugin-compat": "^4.0.0",
170
+ "eslint-plugin-compat": "^4.0.2",
170
171
  "eslint-plugin-eslint-comments": "^3.2.0",
171
- "eslint-plugin-html": "^6.2.0",
172
- "eslint-plugin-import": "^2.25.4",
173
- "eslint-plugin-jsdoc": "^37.5.1",
174
- "eslint-plugin-markdown": "^2.2.1",
175
- "eslint-plugin-no-unsanitized": "^4.0.1",
172
+ "eslint-plugin-html": "^7.1.0",
173
+ "eslint-plugin-import": "^2.26.0",
174
+ "eslint-plugin-jsdoc": "^39.6.4",
175
+ "eslint-plugin-markdown": "^3.0.0",
176
+ "eslint-plugin-no-unsanitized": "^4.0.2",
176
177
  "eslint-plugin-no-use-extend-native": "^0.5.0",
177
178
  "eslint-plugin-node": "^11.1.0",
178
- "eslint-plugin-promise": "^6.0.0",
179
- "eslint-plugin-sonarjs": "^0.11.0",
179
+ "eslint-plugin-promise": "^6.1.1",
180
+ "eslint-plugin-sonarjs": "^0.17.0",
180
181
  "eslint-plugin-standard": "^4.1.0",
181
- "eslint-plugin-unicorn": "^40.0.0",
182
+ "eslint-plugin-unicorn": "^45.0.1",
182
183
  "got": "^11.8.3",
183
184
  "is-date-object": "1.0.5",
184
185
  "isomorphic-fetch": "^3.0.0",
185
- "jsdom": "^19.0.0",
186
+ "jsdom": "^20.0.3",
186
187
  "license-badger": "^0.19.0",
187
188
  "local-xmlhttprequest": "2.0.0",
188
- "mocha": "^9.1.3",
189
- "mocha-badge-generator": "^0.9.0",
189
+ "mocha": "^10.1.0",
190
+ "mocha-badge-generator": "^0.10.6",
190
191
  "mocha-multi-reporters": "^1.5.1",
191
192
  "npm-run-all": "^4.1.5",
192
193
  "nyc": "^15.1.0",
193
- "open-cli": "^7.0.1",
194
+ "open-cli": "^7.1.0",
194
195
  "rimraf": "^3.0.2",
195
- "rollup": "^2.63.0",
196
- "rollup-plugin-filesize": "^9.1.1",
196
+ "rollup": "^3.7.0",
197
+ "rollup-plugin-filesize": "^9.1.2",
197
198
  "rollup-plugin-node-globals": "^1.4.0",
198
199
  "rollup-plugin-node-polyfills": "^0.2.1",
199
- "rollup-plugin-terser": "^7.0.2",
200
- "sinon": "^12.0.1",
200
+ "sinon": "^15.0.0",
201
201
  "source-map-support": "0.5.21",
202
202
  "sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
203
203
  "w3c-blob": "0.0.1",
204
- "ws": "^8.4.0"
204
+ "ws": "^8.11.0"
205
205
  }
206
206
  }
package/src/IDBFactory.js CHANGED
@@ -114,9 +114,7 @@ let sysdb;
114
114
  let nameCounter = 0;
115
115
 
116
116
  function getLatestCachedWebSQLVersion (name) {
117
- return Object.keys(websqlDBCache[name]).map((version) => {
118
- return Number(version);
119
- }).reduce(
117
+ return Object.keys(websqlDBCache[name]).map(Number).reduce(
120
118
  (prev, curr) => {
121
119
  return curr > prev ? curr : prev;
122
120
  }, 0
package/src/Key.js CHANGED
@@ -938,7 +938,7 @@ function setCurrentNumber (tx, store, num, successCb, failCb) {
938
938
  function generateKeyForStore (tx, store, cb, sqlFailCb) {
939
939
  getCurrentNumber(tx, store, function (key) {
940
940
  if (key > MAX_ALLOWED_CURRENT_NUMBER) { // 2 ^ 53 (See <https://github.com/w3c/IndexedDB/issues/147>)
941
- cb('failure'); // eslint-disable-line node/no-callback-literal
941
+ cb('failure'); // eslint-disable-line n/no-callback-literal
942
942
  return;
943
943
  }
944
944
  // Increment current number by 1 (we cannot leverage SQLite's
package/src/Sca.js CHANGED
@@ -1,13 +1,15 @@
1
- import Typeson from 'typeson-registry';
1
+ import {
2
+ Typeson, hasConstructorOf, structuredCloningThrowing
3
+ } from 'typeson-registry';
2
4
 
3
5
  import {createDOMException, ShimDOMException} from './DOMException.js';
4
6
 
5
7
  // See: http://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
6
8
 
7
- let typeson = new Typeson().register(Typeson.presets.structuredCloningThrowing);
9
+ let typeson = new Typeson().register(structuredCloningThrowing);
8
10
 
9
11
  function register (func) {
10
- typeson = new Typeson().register(func(Typeson.presets.structuredCloningThrowing));
12
+ typeson = new Typeson().register(func(structuredCloningThrowing));
11
13
  }
12
14
 
13
15
  // We are keeping the callback approach for now in case we wish to reexpose
@@ -16,16 +18,16 @@ function register (func) {
16
18
  function encode (obj, func) {
17
19
  let ret;
18
20
  try {
19
- // eslint-disable-next-line node/no-sync
21
+ // eslint-disable-next-line n/no-sync
20
22
  ret = typeson.stringifySync(obj);
21
23
  } catch (err) {
22
24
  // SCA in typeson-registry using `DOMException` which is not defined (e.g., in Node)
23
- if (Typeson.hasConstructorOf(err, ReferenceError) ||
25
+ if (hasConstructorOf(err, ReferenceError) ||
24
26
  // SCA in typeson-registry threw a cloning error and we are in a
25
27
  // supporting environment (e.g., the browser) where `ShimDOMException` is
26
28
  // an alias for `DOMException`; if typeson-registry ever uses our shim
27
29
  // to throw, we can use this condition alone.
28
- Typeson.hasConstructorOf(err, ShimDOMException)) {
30
+ hasConstructorOf(err, ShimDOMException)) {
29
31
  throw createDOMException('DataCloneError', 'The object cannot be cloned.');
30
32
  }
31
33
  // We should rethrow non-cloning exceptions like from