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.
- package/README.md +3 -146
- package/dist/CFG.d.ts +1 -0
- package/dist/CFG.d.ts.map +1 -1
- package/dist/DOMException.d.ts +4 -4
- package/dist/DOMException.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +3 -2
- package/dist/indexeddbshim-Key.js.map +1 -1
- package/dist/indexeddbshim-Key.min.js +2 -2
- package/dist/indexeddbshim-Key.min.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +48 -34
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +33 -33
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +48 -34
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +33 -33
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +33 -33
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/nodeSQLiteDatabase.d.ts.map +1 -1
- package/dist/nodeWebSQL.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/CFG.js +2 -0
- package/src/DOMException.js +21 -21
- package/src/IDBObjectStore.js +1 -1
- package/src/nodeSQLiteDatabase.js +10 -1
- package/src/nodeWebSQL.js +3 -0
- package/src/setGlobalVars.js +3 -3
package/dist/indexeddbshim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v17.
|
|
1
|
+
/*! indexeddbshim - v17.4.0 - 8/27/2026 */
|
|
2
2
|
|
|
3
3
|
(function (factory) {
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -1754,6 +1754,7 @@
|
|
|
1754
1754
|
* sqlBusyTimeout: number,
|
|
1755
1755
|
* sqlTrace: () => void,
|
|
1756
1756
|
* sqlProfile: () => void,
|
|
1757
|
+
* sqlMemoryQuota: number,
|
|
1757
1758
|
* escapeNULForSQLiteStatements: boolean,
|
|
1758
1759
|
* createIndexes: boolean
|
|
1759
1760
|
* }} ConfigValues
|
|
@@ -1910,7 +1911,7 @@
|
|
|
1910
1911
|
'sqlProfile',
|
|
1911
1912
|
// Callback not used by default
|
|
1912
1913
|
// Defaults to true except in Node builds where we can preserve literal NUL with better-sqlite3
|
|
1913
|
-
'escapeNULForSQLiteStatements', 'createIndexes'].forEach(function (prop) {
|
|
1914
|
+
'escapeNULForSQLiteStatements', 'sqlMemoryQuota', 'createIndexes'].forEach(function (prop) {
|
|
1914
1915
|
/** @type {(val: any) => void} */
|
|
1915
1916
|
var validator;
|
|
1916
1917
|
if (Array.isArray(prop)) {
|
|
@@ -2931,41 +2932,40 @@
|
|
|
2931
2932
|
* optional here and, in practice, always `undefined` today (the `case 4`/
|
|
2932
2933
|
* `case 7` branches below are effectively unreachable pending upstream
|
|
2933
2934
|
* support for surfacing a real error code).
|
|
2934
|
-
* @param {Error & {code?: number}} webSQLErr
|
|
2935
|
+
* @param {Error & {code?: number|string}} webSQLErr
|
|
2935
2936
|
* @returns {(DOMException|Error) & {
|
|
2936
|
-
* sqlError: Error & {code?: number}
|
|
2937
|
+
* sqlError: Error & {code?: number|string}
|
|
2937
2938
|
* }|QuotaExceededError}
|
|
2938
2939
|
*/
|
|
2939
2940
|
function webSQLErrback(webSQLErr) {
|
|
2940
2941
|
var name,
|
|
2941
2942
|
message,
|
|
2942
2943
|
useQuotaExceededError = false;
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
if (typeof QuotaExceededError !== 'undefined') {
|
|
2950
|
-
useQuotaExceededError = true;
|
|
2951
|
-
}
|
|
2952
|
-
break;
|
|
2953
|
-
}
|
|
2954
|
-
/*
|
|
2955
|
-
// Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
|
|
2956
|
-
case 7: { // SQLError.TIMEOUT_ERR
|
|
2957
|
-
// All transaction errors abort later, so no need to mark inactive
|
|
2958
|
-
name = 'TransactionInactiveError';
|
|
2959
|
-
message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
|
|
2960
|
-
break;
|
|
2944
|
+
if (webSQLErr.code === 4 || webSQLErr.code === 'SQLITE_FULL') {
|
|
2945
|
+
// SQLError.QUOTA_ERR or better-sqlite3 SQLITE_FULL
|
|
2946
|
+
name = 'QuotaExceededError';
|
|
2947
|
+
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.';
|
|
2948
|
+
if (typeof QuotaExceededError !== 'undefined') {
|
|
2949
|
+
useQuotaExceededError = true;
|
|
2961
2950
|
}
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2951
|
+
} else {
|
|
2952
|
+
switch (webSQLErr.code) {
|
|
2953
|
+
/*
|
|
2954
|
+
// Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
|
|
2955
|
+
case 7: { // SQLError.TIMEOUT_ERR
|
|
2956
|
+
// All transaction errors abort later, so no need to mark inactive
|
|
2957
|
+
name = 'TransactionInactiveError';
|
|
2958
|
+
message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
|
|
2959
|
+
break;
|
|
2968
2960
|
}
|
|
2961
|
+
*/
|
|
2962
|
+
default:
|
|
2963
|
+
{
|
|
2964
|
+
name = 'UnknownError';
|
|
2965
|
+
message = 'The operation failed for reasons unrelated to the database itself and not covered by any other errors.';
|
|
2966
|
+
break;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
2969
|
}
|
|
2970
2970
|
message += ' (' + webSQLErr.message + ')--(' + webSQLErr.code + ')';
|
|
2971
2971
|
if (useQuotaExceededError) {
|
|
@@ -2974,7 +2974,7 @@
|
|
|
2974
2974
|
var err =
|
|
2975
2975
|
/**
|
|
2976
2976
|
* @type {(Error | DOMException) & {
|
|
2977
|
-
* sqlError: Error & {code?: number}
|
|
2977
|
+
* sqlError: Error & {code?: number|string}
|
|
2978
2978
|
* }}
|
|
2979
2979
|
*/
|
|
2980
2980
|
createDOMException(name, message);
|
|
@@ -9560,7 +9560,7 @@
|
|
|
9560
9560
|
tx.executeSql('INSERT INTO __sys__ VALUES (?,?,?,?,?)', [escapeSQLiteStatement(storeName), encodedKeyPath,
|
|
9561
9561
|
// For why converting here, see comment and following
|
|
9562
9562
|
// discussion at:
|
|
9563
|
-
// https://github.com/
|
|
9563
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/313#issuecomment-590086778
|
|
9564
9564
|
Number(store.autoIncrement), '{}', 1], function () {
|
|
9565
9565
|
delete store.__pendingCreate;
|
|
9566
9566
|
delete store.__deleted;
|
|
@@ -14003,7 +14003,7 @@
|
|
|
14003
14003
|
// Ignore Node or other environments
|
|
14004
14004
|
// Bad non-Chrome Android support
|
|
14005
14005
|
/Android (?:2|3|4\.[0-3])/.test(navigator.userAgent) && !navigator.userAgent.includes('Chrome') ||
|
|
14006
|
-
// Bad non-Safari iOS9 support (see <https://github.com/
|
|
14006
|
+
// Bad non-Safari iOS9 support (see <https://github.com/indexeddbshim/IndexedDBShim/issues/252>)
|
|
14007
14007
|
(!navigator.userAgent.includes('Safari') || navigator.userAgent.includes('Chrome')) &&
|
|
14008
14008
|
// Exclude genuine Safari: https://stackoverflow.com/a/7768006/271577
|
|
14009
14009
|
// Detect iOS: https://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
|
|
@@ -14013,8 +14013,8 @@
|
|
|
14013
14013
|
if (!CFG.DEFAULT_DB_SIZE) {
|
|
14014
14014
|
CFG.DEFAULT_DB_SIZE = (
|
|
14015
14015
|
// Safari currently requires larger size: (We don't need a larger size for Node as node-websql doesn't use this info)
|
|
14016
|
-
// https://github.com/
|
|
14017
|
-
// https://github.com/
|
|
14016
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/41
|
|
14017
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/115
|
|
14018
14018
|
typeof navigator !== 'undefined' &&
|
|
14019
14019
|
// React Native
|
|
14020
14020
|
navigator.userAgent && navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome') ? 25 : 4) * 1024 * 1024;
|