indexeddbshim 17.3.4 → 17.4.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.
Files changed (34) hide show
  1. package/README.md +3 -146
  2. package/dist/CFG.d.ts +1 -0
  3. package/dist/CFG.d.ts.map +1 -1
  4. package/dist/DOMException.d.ts +4 -4
  5. package/dist/DOMException.d.ts.map +1 -1
  6. package/dist/indexeddbshim-Key.js +3 -2
  7. package/dist/indexeddbshim-Key.js.map +1 -1
  8. package/dist/indexeddbshim-Key.min.js +2 -2
  9. package/dist/indexeddbshim-Key.min.js.map +1 -1
  10. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +48 -34
  11. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  12. package/dist/indexeddbshim-UnicodeIdentifiers.js +33 -33
  13. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  14. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  15. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  16. package/dist/indexeddbshim-node.cjs +48 -34
  17. package/dist/indexeddbshim-node.cjs.map +1 -1
  18. package/dist/indexeddbshim-noninvasive.js +33 -33
  19. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  20. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  21. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  22. package/dist/indexeddbshim.js +33 -33
  23. package/dist/indexeddbshim.js.map +1 -1
  24. package/dist/indexeddbshim.min.js +2 -2
  25. package/dist/indexeddbshim.min.js.map +1 -1
  26. package/dist/nodeSQLiteDatabase.d.ts.map +1 -1
  27. package/dist/nodeWebSQL.d.ts.map +1 -1
  28. package/package.json +6 -7
  29. package/src/CFG.js +2 -0
  30. package/src/DOMException.js +21 -21
  31. package/src/IDBObjectStore.js +1 -1
  32. package/src/nodeSQLiteDatabase.js +10 -1
  33. package/src/nodeWebSQL.js +3 -0
  34. package/src/setGlobalVars.js +3 -3
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v17.3.4 - 8/25/2026 */
1
+ /*! indexeddbshim - v17.4.0 - 8/27/2026 */
2
2
 
3
3
  (function (factory) {
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -1767,6 +1767,7 @@
1767
1767
  * sqlBusyTimeout: number,
1768
1768
  * sqlTrace: () => void,
1769
1769
  * sqlProfile: () => void,
1770
+ * sqlMemoryQuota: number,
1770
1771
  * escapeNULForSQLiteStatements: boolean,
1771
1772
  * createIndexes: boolean
1772
1773
  * }} ConfigValues
@@ -1923,7 +1924,7 @@
1923
1924
  'sqlProfile',
1924
1925
  // Callback not used by default
1925
1926
  // Defaults to true except in Node builds where we can preserve literal NUL with better-sqlite3
1926
- 'escapeNULForSQLiteStatements', 'createIndexes'].forEach(function (prop) {
1927
+ 'escapeNULForSQLiteStatements', 'sqlMemoryQuota', 'createIndexes'].forEach(function (prop) {
1927
1928
  /** @type {(val: any) => void} */
1928
1929
  var validator;
1929
1930
  if (Array.isArray(prop)) {
@@ -2944,41 +2945,40 @@
2944
2945
  * optional here and, in practice, always `undefined` today (the `case 4`/
2945
2946
  * `case 7` branches below are effectively unreachable pending upstream
2946
2947
  * support for surfacing a real error code).
2947
- * @param {Error & {code?: number}} webSQLErr
2948
+ * @param {Error & {code?: number|string}} webSQLErr
2948
2949
  * @returns {(DOMException|Error) & {
2949
- * sqlError: Error & {code?: number}
2950
+ * sqlError: Error & {code?: number|string}
2950
2951
  * }|QuotaExceededError}
2951
2952
  */
2952
2953
  function webSQLErrback(webSQLErr) {
2953
2954
  var name,
2954
2955
  message,
2955
2956
  useQuotaExceededError = false;
2956
- switch (webSQLErr.code) {
2957
- case 4:
2958
- {
2959
- // SQLError.QUOTA_ERR
2960
- name = 'QuotaExceededError';
2961
- message = 'The operation failed because there was not enough ' + 'remaining storage space, or the storage quota was reached ' + 'and the user declined to give more space to the database.';
2962
- if (typeof QuotaExceededError !== 'undefined') {
2963
- useQuotaExceededError = true;
2964
- }
2965
- break;
2966
- }
2967
- /*
2968
- // Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
2969
- case 7: { // SQLError.TIMEOUT_ERR
2970
- // All transaction errors abort later, so no need to mark inactive
2971
- name = 'TransactionInactiveError';
2972
- message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
2973
- break;
2957
+ if (webSQLErr.code === 4 || webSQLErr.code === 'SQLITE_FULL') {
2958
+ // SQLError.QUOTA_ERR or better-sqlite3 SQLITE_FULL
2959
+ name = 'QuotaExceededError';
2960
+ message = 'The operation failed because there was not enough ' + 'remaining storage space, or the storage quota was reached ' + 'and the user declined to give more space to the database.';
2961
+ if (typeof QuotaExceededError !== 'undefined') {
2962
+ useQuotaExceededError = true;
2974
2963
  }
2975
- */
2976
- default:
2977
- {
2978
- name = 'UnknownError';
2979
- message = 'The operation failed for reasons unrelated to the database itself and not covered by any other errors.';
2980
- break;
2964
+ } else {
2965
+ switch (webSQLErr.code) {
2966
+ /*
2967
+ // Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
2968
+ case 7: { // SQLError.TIMEOUT_ERR
2969
+ // All transaction errors abort later, so no need to mark inactive
2970
+ name = 'TransactionInactiveError';
2971
+ message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
2972
+ break;
2981
2973
  }
2974
+ */
2975
+ default:
2976
+ {
2977
+ name = 'UnknownError';
2978
+ message = 'The operation failed for reasons unrelated to the database itself and not covered by any other errors.';
2979
+ break;
2980
+ }
2981
+ }
2982
2982
  }
2983
2983
  message += ' (' + webSQLErr.message + ')--(' + webSQLErr.code + ')';
2984
2984
  if (useQuotaExceededError) {
@@ -2987,7 +2987,7 @@
2987
2987
  var err =
2988
2988
  /**
2989
2989
  * @type {(Error | DOMException) & {
2990
- * sqlError: Error & {code?: number}
2990
+ * sqlError: Error & {code?: number|string}
2991
2991
  * }}
2992
2992
  */
2993
2993
  createDOMException(name, message);
@@ -9573,7 +9573,7 @@
9573
9573
  tx.executeSql('INSERT INTO __sys__ VALUES (?,?,?,?,?)', [escapeSQLiteStatement(storeName), encodedKeyPath,
9574
9574
  // For why converting here, see comment and following
9575
9575
  // discussion at:
9576
- // https://github.com/axemclion/IndexedDBShim/issues/313#issuecomment-590086778
9576
+ // https://github.com/indexeddbshim/IndexedDBShim/issues/313#issuecomment-590086778
9577
9577
  Number(store.autoIncrement), '{}', 1], function () {
9578
9578
  delete store.__pendingCreate;
9579
9579
  delete store.__deleted;
@@ -14016,7 +14016,7 @@
14016
14016
  // Ignore Node or other environments
14017
14017
  // Bad non-Chrome Android support
14018
14018
  /Android (?:2|3|4\.[0-3])/.test(navigator.userAgent) && !navigator.userAgent.includes('Chrome') ||
14019
- // Bad non-Safari iOS9 support (see <https://github.com/axemclion/IndexedDBShim/issues/252>)
14019
+ // Bad non-Safari iOS9 support (see <https://github.com/indexeddbshim/IndexedDBShim/issues/252>)
14020
14020
  (!navigator.userAgent.includes('Safari') || navigator.userAgent.includes('Chrome')) &&
14021
14021
  // Exclude genuine Safari: https://stackoverflow.com/a/7768006/271577
14022
14022
  // Detect iOS: https://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
@@ -14026,8 +14026,8 @@
14026
14026
  if (!CFG.DEFAULT_DB_SIZE) {
14027
14027
  CFG.DEFAULT_DB_SIZE = (
14028
14028
  // Safari currently requires larger size: (We don't need a larger size for Node as node-websql doesn't use this info)
14029
- // https://github.com/axemclion/IndexedDBShim/issues/41
14030
- // https://github.com/axemclion/IndexedDBShim/issues/115
14029
+ // https://github.com/indexeddbshim/IndexedDBShim/issues/41
14030
+ // https://github.com/indexeddbshim/IndexedDBShim/issues/115
14031
14031
  typeof navigator !== 'undefined' &&
14032
14032
  // React Native
14033
14033
  navigator.userAgent && navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome') ? 25 : 4) * 1024 * 1024;