indexeddbshim 8.0.0 → 9.0.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": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "author": "Parashuram <code@nparashuram.com>",
5
5
  "contributors": [
6
6
  "Brett Zamir"
@@ -129,7 +129,7 @@
129
129
  "last 3 Samsung versions"
130
130
  ],
131
131
  "engines": {
132
- "node": ">=10.0.0"
132
+ "node": ">=12.0.0"
133
133
  },
134
134
  "dependencies": {
135
135
  "eventtargeter": "0.8.0",
@@ -139,68 +139,68 @@
139
139
  "websql": "git+https://github.com/brettz9/node-websql.git#configurable-secure3"
140
140
  },
141
141
  "devDependencies": {
142
- "@babel/core": "^7.14.6",
143
- "@babel/preset-env": "^7.14.5",
144
- "@brettz9/eslint-plugin": "^1.0.3",
142
+ "@babel/core": "^7.16.7",
143
+ "@babel/preset-env": "^7.16.7",
144
+ "@brettz9/eslint-plugin": "^1.0.4",
145
145
  "@brettz9/node-static": "^0.1.1",
146
146
  "@mochajs/json-file-reporter": "^1.3.0",
147
147
  "@rollup/plugin-babel": "^5.3.0",
148
- "@rollup/plugin-commonjs": "^19.0.0",
148
+ "@rollup/plugin-commonjs": "^21.0.1",
149
149
  "@rollup/plugin-json": "^4.1.0",
150
- "@rollup/plugin-node-resolve": "^13.0.0",
151
- "@rollup/plugin-replace": "^2.4.2",
152
- "@unicode/unicode-13.0.0": "1.0.6",
150
+ "@rollup/plugin-node-resolve": "^13.1.2",
151
+ "@rollup/plugin-replace": "^3.0.1",
152
+ "@unicode/unicode-13.0.0": "1.2.1",
153
153
  "babel-plugin-add-module-exports": "1.0.4",
154
- "bson": "^4.4.0",
154
+ "bson": "^4.6.0",
155
155
  "builtin-modules": "^3.2.0",
156
156
  "canvas": "^2.8.0",
157
157
  "chai": "4.3.4",
158
- "chokidar-cli": "^2.1.0",
158
+ "chokidar-cli": "^3.0.0",
159
159
  "colors": "1.4.0",
160
160
  "copyfiles": "^2.4.1",
161
- "core-js-bundle": "^3.14.0",
161
+ "core-js-bundle": "^3.20.2",
162
162
  "coveradge": "^0.7.0",
163
163
  "cyclonejs": "1.1.4",
164
164
  "delay-cli": "^1.1.0",
165
- "eslint": "^7.28.0",
166
- "eslint-config-ash-nazg": "^29.17.0",
165
+ "eslint": "^8.6.0",
166
+ "eslint-config-ash-nazg": "^32.3.0",
167
167
  "eslint-config-standard": "^16.0.3",
168
168
  "eslint-plugin-array-func": "^3.1.7",
169
- "eslint-plugin-compat": "^3.9.0",
169
+ "eslint-plugin-compat": "^4.0.0",
170
170
  "eslint-plugin-eslint-comments": "^3.2.0",
171
- "eslint-plugin-html": "^6.1.2",
172
- "eslint-plugin-import": "^2.23.4",
173
- "eslint-plugin-jsdoc": "^35.2.0",
174
- "eslint-plugin-markdown": "^2.2.0",
175
- "eslint-plugin-no-unsanitized": "^3.1.5",
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",
176
176
  "eslint-plugin-no-use-extend-native": "^0.5.0",
177
177
  "eslint-plugin-node": "^11.1.0",
178
- "eslint-plugin-promise": "^5.1.0",
179
- "eslint-plugin-radar": "^0.2.1",
178
+ "eslint-plugin-promise": "^6.0.0",
179
+ "eslint-plugin-sonarjs": "^0.11.0",
180
180
  "eslint-plugin-standard": "^4.1.0",
181
- "eslint-plugin-unicorn": "^33.0.1",
182
- "got": "^11.8.2",
183
- "is-date-object": "1.0.4",
181
+ "eslint-plugin-unicorn": "^40.0.0",
182
+ "got": "^11.8.3",
183
+ "is-date-object": "1.0.5",
184
184
  "isomorphic-fetch": "^3.0.0",
185
- "jsdom": "^16.6.0",
185
+ "jsdom": "^19.0.0",
186
186
  "license-badger": "^0.19.0",
187
187
  "local-xmlhttprequest": "2.0.0",
188
- "mocha": "^9.0.0",
188
+ "mocha": "^9.1.3",
189
189
  "mocha-badge-generator": "^0.9.0",
190
190
  "mocha-multi-reporters": "^1.5.1",
191
191
  "npm-run-all": "^4.1.5",
192
192
  "nyc": "^15.1.0",
193
- "open-cli": "^7.0.0",
193
+ "open-cli": "^7.0.1",
194
194
  "rimraf": "^3.0.2",
195
- "rollup": "^2.51.2",
195
+ "rollup": "^2.63.0",
196
196
  "rollup-plugin-filesize": "^9.1.1",
197
197
  "rollup-plugin-node-globals": "^1.4.0",
198
198
  "rollup-plugin-node-polyfills": "^0.2.1",
199
199
  "rollup-plugin-terser": "^7.0.2",
200
- "sinon": "^11.1.1",
201
- "source-map-support": "0.5.19",
200
+ "sinon": "^12.0.1",
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": "^7.4.6"
204
+ "ws": "^8.4.0"
205
205
  }
206
206
  }
@@ -61,11 +61,11 @@ DOMStringList.prototype = {
61
61
  return this._items;
62
62
  },
63
63
  forEach (cb, thisArg) {
64
- // eslint-disable-next-line unicorn/no-array-callback-reference
64
+ // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
65
65
  this._items.forEach(cb, thisArg);
66
66
  },
67
67
  map (cb, thisArg) {
68
- // eslint-disable-next-line unicorn/no-array-callback-reference
68
+ // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
69
69
  return this._items.map(cb, thisArg);
70
70
  },
71
71
  indexOf (str) {
package/src/IDBFactory.js CHANGED
@@ -312,7 +312,7 @@ IDBFactory.prototype.open = function (name /* , version */) {
312
312
  // eslint-disable-next-line no-useless-catch
313
313
  try {
314
314
  escapedDatabaseName = util.escapeDatabaseNameForSQLAndFiles(name);
315
- // eslint-disable-next-line radar/no-useless-catch
315
+ // eslint-disable-next-line sonarjs/no-useless-catch
316
316
  } catch (err) {
317
317
  throw err; // new TypeError('You have supplied a database name which does not match the currently supported configuration, possibly due to a length limit enforced for Node compatibility.');
318
318
  }
@@ -590,7 +590,7 @@ IDBFactory.prototype.deleteDatabase = function (name) {
590
590
  // eslint-disable-next-line no-useless-catch
591
591
  try {
592
592
  escapedDatabaseName = util.escapeDatabaseNameForSQLAndFiles(name);
593
- // eslint-disable-next-line radar/no-useless-catch
593
+ // eslint-disable-next-line sonarjs/no-useless-catch
594
594
  } catch (err) {
595
595
  throw err; // throw new TypeError('You have supplied a database name which does not match the currently supported configuration, possibly due to a length limit enforced for Node compatibility.');
596
596
  }
package/src/IDBRequest.js CHANGED
@@ -20,7 +20,7 @@ IDBRequest.__super = function IDBRequest () {
20
20
  this.__setOptions({
21
21
  legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
22
22
  });
23
- doneFlagGetters.forEach(function (prop) {
23
+ doneFlagGetters.forEach((prop) => {
24
24
  Object.defineProperty(this, '__' + prop, {
25
25
  enumerable: false,
26
26
  configurable: false,
@@ -36,7 +36,7 @@ IDBRequest.__super = function IDBRequest () {
36
36
  return this['__' + prop];
37
37
  }
38
38
  });
39
- }, this);
39
+ });
40
40
  util.defineReadonlyProperties(this, readonlyProperties, {
41
41
  readyState: {
42
42
  get readyState () {
package/src/Key.js CHANGED
@@ -21,7 +21,7 @@ const keyTypeToEncodedChar = {
21
21
  };
22
22
  const keyTypes = Object.keys(keyTypeToEncodedChar);
23
23
  keyTypes.forEach((k) => {
24
- keyTypeToEncodedChar[k] = String.fromCharCode(keyTypeToEncodedChar[k]);
24
+ keyTypeToEncodedChar[k] = String.fromCodePoint(keyTypeToEncodedChar[k]);
25
25
  });
26
26
 
27
27
  const encodedCharToKeyType = keyTypes.reduce((o, k) => {
@@ -11,7 +11,6 @@ CFG.win = typeof window !== 'undefined' ? window : self; // For Web Workers
11
11
  setGlobalVars();
12
12
  // END: Same code as in browser.js
13
13
 
14
- // eslint-disable-next-line unicorn/prefer-prototype-methods
15
14
  const __setUnicodeIdentifiers = shimIndexedDB.__setUnicodeIdentifiers.bind(
16
15
  shimIndexedDB
17
16
  );
@@ -60,7 +60,6 @@ function setGlobalVars (idb, initialConfig) {
60
60
  } else {
61
61
  const o = {
62
62
  get [name] () {
63
- // eslint-disable-next-line unicorn/prefer-prototype-methods
64
63
  return propDesc.get.call(this);
65
64
  }
66
65
  };
@@ -114,7 +113,6 @@ function setGlobalVars (idb, initialConfig) {
114
113
  }
115
114
  const shimIDBFactory = IDBFactory;
116
115
  if (CFG.win.openDatabase !== undefined) {
117
- // eslint-disable-next-line unicorn/prefer-prototype-methods
118
116
  shimIndexedDB.__openDatabase = CFG.win.openDatabase.bind(CFG.win); // We cache here in case the function is overwritten later as by the IndexedDB support promises tests
119
117
  // Polyfill ALL of IndexedDB, using WebSQL
120
118
  shim('indexedDB', shimIndexedDB, {
@@ -1,3 +1,3 @@
1
1
  var regex=/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
2
2
 
3
- export default regex;
3
+ export { regex as default };
package/src/util.js CHANGED
@@ -9,11 +9,11 @@ function escapeUnmatchedSurrogates (arg) {
9
9
  // Could add a corresponding surrogate for compatibility with `node-sqlite3`: http://bugs.python.org/issue12569 and http://stackoverflow.com/a/6701665/271577
10
10
  // but Chrome having problems
11
11
  if (unmatchedHighSurrogate) {
12
- return '^2' + unmatchedHighSurrogate.charCodeAt()
12
+ return '^2' + unmatchedHighSurrogate.codePointAt()
13
13
  .toString(16).padStart(4, '0');
14
14
  }
15
15
  return (precedingLow || '') + '^3' +
16
- unmatchedLowSurrogate.charCodeAt().toString(16).padStart(4, '0');
16
+ unmatchedLowSurrogate.codePointAt().toString(16).padStart(4, '0');
17
17
  }
18
18
  );
19
19
  }
@@ -80,6 +80,7 @@ function escapeDatabaseNameForSQLAndFiles (db) {
80
80
  ? new RegExp(CFG.databaseCharacterEscapeList, 'gu')
81
81
  : /[\u0000-\u001F\u007F"*/:<>?\\|]/gu), // eslint-disable-line no-control-regex
82
82
  function (n0) {
83
+ // eslint-disable-next-line unicorn/prefer-code-point -- Switch to `codePointAt`?
83
84
  return '^1' + n0.charCodeAt().toString(16).padStart(2, '0');
84
85
  }
85
86
  );
@@ -98,11 +99,11 @@ function unescapeUnmatchedSurrogates (arg) {
98
99
  return arg
99
100
  .replace(/(\^+)3(d[0-9a-f]{3})/gu, (_, esc, lowSurr) => {
100
101
  return esc.length % 2
101
- ? esc.slice(1) + String.fromCharCode(Number.parseInt(lowSurr, 16))
102
+ ? esc.slice(1) + String.fromCodePoint(Number.parseInt(lowSurr, 16))
102
103
  : _;
103
104
  }).replace(/(\^+)2(d[0-9a-f]{3})/gu, (_, esc, highSurr) => {
104
105
  return esc.length % 2
105
- ? esc.slice(1) + String.fromCharCode(Number.parseInt(highSurr, 16))
106
+ ? esc.slice(1) + String.fromCodePoint(Number.parseInt(highSurr, 16))
106
107
  : _;
107
108
  });
108
109
  }
@@ -122,7 +123,7 @@ function unescapeDatabaseNameForSQLAndFiles (db) {
122
123
  // CFG.databaseCharacterEscapeList
123
124
  .replace(/(\^+)1([0-9a-f]{2})/gu, (_, esc, hex) => {
124
125
  return esc.length % 2
125
- ? esc.slice(1) + String.fromCharCode(Number.parseInt(hex, 16))
126
+ ? esc.slice(1) + String.fromCodePoint(Number.parseInt(hex, 16))
126
127
  : _;
127
128
  // CFG.escapeNFDForDatabaseNames
128
129
  }).replace(/(\^+)4([0-9a-f]{6})/gu, (_, esc, hex) => {