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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v17.
|
|
1
|
+
/*! indexeddbshim - v17.4.0 - 8/27/2026 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -1762,6 +1762,7 @@
|
|
|
1762
1762
|
* sqlBusyTimeout: number,
|
|
1763
1763
|
* sqlTrace: () => void,
|
|
1764
1764
|
* sqlProfile: () => void,
|
|
1765
|
+
* sqlMemoryQuota: number,
|
|
1765
1766
|
* escapeNULForSQLiteStatements: boolean,
|
|
1766
1767
|
* createIndexes: boolean
|
|
1767
1768
|
* }} ConfigValues
|
|
@@ -1918,7 +1919,7 @@
|
|
|
1918
1919
|
'sqlProfile',
|
|
1919
1920
|
// Callback not used by default
|
|
1920
1921
|
// Defaults to true except in Node builds where we can preserve literal NUL with better-sqlite3
|
|
1921
|
-
'escapeNULForSQLiteStatements', 'createIndexes'].forEach(function (prop) {
|
|
1922
|
+
'escapeNULForSQLiteStatements', 'sqlMemoryQuota', 'createIndexes'].forEach(function (prop) {
|
|
1922
1923
|
/** @type {(val: any) => void} */
|
|
1923
1924
|
var validator;
|
|
1924
1925
|
if (Array.isArray(prop)) {
|
|
@@ -2939,41 +2940,40 @@
|
|
|
2939
2940
|
* optional here and, in practice, always `undefined` today (the `case 4`/
|
|
2940
2941
|
* `case 7` branches below are effectively unreachable pending upstream
|
|
2941
2942
|
* support for surfacing a real error code).
|
|
2942
|
-
* @param {Error & {code?: number}} webSQLErr
|
|
2943
|
+
* @param {Error & {code?: number|string}} webSQLErr
|
|
2943
2944
|
* @returns {(DOMException|Error) & {
|
|
2944
|
-
* sqlError: Error & {code?: number}
|
|
2945
|
+
* sqlError: Error & {code?: number|string}
|
|
2945
2946
|
* }|QuotaExceededError}
|
|
2946
2947
|
*/
|
|
2947
2948
|
function webSQLErrback(webSQLErr) {
|
|
2948
2949
|
var name,
|
|
2949
2950
|
message,
|
|
2950
2951
|
useQuotaExceededError = false;
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
if (typeof QuotaExceededError !== 'undefined') {
|
|
2958
|
-
useQuotaExceededError = true;
|
|
2959
|
-
}
|
|
2960
|
-
break;
|
|
2961
|
-
}
|
|
2962
|
-
/*
|
|
2963
|
-
// Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
|
|
2964
|
-
case 7: { // SQLError.TIMEOUT_ERR
|
|
2965
|
-
// All transaction errors abort later, so no need to mark inactive
|
|
2966
|
-
name = 'TransactionInactiveError';
|
|
2967
|
-
message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
|
|
2968
|
-
break;
|
|
2952
|
+
if (webSQLErr.code === 4 || webSQLErr.code === 'SQLITE_FULL') {
|
|
2953
|
+
// SQLError.QUOTA_ERR or better-sqlite3 SQLITE_FULL
|
|
2954
|
+
name = 'QuotaExceededError';
|
|
2955
|
+
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.';
|
|
2956
|
+
if (typeof QuotaExceededError !== 'undefined') {
|
|
2957
|
+
useQuotaExceededError = true;
|
|
2969
2958
|
}
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2959
|
+
} else {
|
|
2960
|
+
switch (webSQLErr.code) {
|
|
2961
|
+
/*
|
|
2962
|
+
// Should a WebSQL timeout treat as IndexedDB `TransactionInactiveError` or `UnknownError`?
|
|
2963
|
+
case 7: { // SQLError.TIMEOUT_ERR
|
|
2964
|
+
// All transaction errors abort later, so no need to mark inactive
|
|
2965
|
+
name = 'TransactionInactiveError';
|
|
2966
|
+
message = 'A request was placed against a transaction which is currently not active, or which is finished (Internal SQL Timeout).';
|
|
2967
|
+
break;
|
|
2976
2968
|
}
|
|
2969
|
+
*/
|
|
2970
|
+
default:
|
|
2971
|
+
{
|
|
2972
|
+
name = 'UnknownError';
|
|
2973
|
+
message = 'The operation failed for reasons unrelated to the database itself and not covered by any other errors.';
|
|
2974
|
+
break;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
2977
|
}
|
|
2978
2978
|
message += ' (' + webSQLErr.message + ')--(' + webSQLErr.code + ')';
|
|
2979
2979
|
if (useQuotaExceededError) {
|
|
@@ -2982,7 +2982,7 @@
|
|
|
2982
2982
|
var err =
|
|
2983
2983
|
/**
|
|
2984
2984
|
* @type {(Error | DOMException) & {
|
|
2985
|
-
* sqlError: Error & {code?: number}
|
|
2985
|
+
* sqlError: Error & {code?: number|string}
|
|
2986
2986
|
* }}
|
|
2987
2987
|
*/
|
|
2988
2988
|
createDOMException(name, message);
|
|
@@ -9568,7 +9568,7 @@
|
|
|
9568
9568
|
tx.executeSql('INSERT INTO __sys__ VALUES (?,?,?,?,?)', [escapeSQLiteStatement(storeName), encodedKeyPath,
|
|
9569
9569
|
// For why converting here, see comment and following
|
|
9570
9570
|
// discussion at:
|
|
9571
|
-
// https://github.com/
|
|
9571
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/313#issuecomment-590086778
|
|
9572
9572
|
Number(store.autoIncrement), '{}', 1], function () {
|
|
9573
9573
|
delete store.__pendingCreate;
|
|
9574
9574
|
delete store.__deleted;
|
|
@@ -14014,7 +14014,7 @@
|
|
|
14014
14014
|
// Ignore Node or other environments
|
|
14015
14015
|
// Bad non-Chrome Android support
|
|
14016
14016
|
/Android (?:2|3|4\.[0-3])/.test(navigator.userAgent) && !navigator.userAgent.includes('Chrome') ||
|
|
14017
|
-
// Bad non-Safari iOS9 support (see <https://github.com/
|
|
14017
|
+
// Bad non-Safari iOS9 support (see <https://github.com/indexeddbshim/IndexedDBShim/issues/252>)
|
|
14018
14018
|
(!navigator.userAgent.includes('Safari') || navigator.userAgent.includes('Chrome')) &&
|
|
14019
14019
|
// Exclude genuine Safari: https://stackoverflow.com/a/7768006/271577
|
|
14020
14020
|
// Detect iOS: https://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
|
|
@@ -14024,8 +14024,8 @@
|
|
|
14024
14024
|
if (!CFG.DEFAULT_DB_SIZE) {
|
|
14025
14025
|
CFG.DEFAULT_DB_SIZE = (
|
|
14026
14026
|
// Safari currently requires larger size: (We don't need a larger size for Node as node-websql doesn't use this info)
|
|
14027
|
-
// https://github.com/
|
|
14028
|
-
// https://github.com/
|
|
14027
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/41
|
|
14028
|
+
// https://github.com/indexeddbshim/IndexedDBShim/issues/115
|
|
14029
14029
|
typeof navigator !== 'undefined' &&
|
|
14030
14030
|
// React Native
|
|
14031
14031
|
navigator.userAgent && navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome') ? 25 : 4) * 1024 * 1024;
|