indexeddbshim 18.0.0 → 19.0.1
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/dist/DOMException.d.ts +3 -7
- package/dist/DOMException.d.ts.map +1 -1
- package/dist/DOMStringList.d.ts +1 -2
- package/dist/DOMStringList.d.ts.map +1 -1
- package/dist/IDBCursor.d.ts +100 -52
- package/dist/IDBCursor.d.ts.map +1 -1
- package/dist/IDBFactory.d.ts.map +1 -1
- package/dist/IDBIndex.d.ts +8 -7
- package/dist/IDBIndex.d.ts.map +1 -1
- package/dist/IDBKeyRange.d.ts +3 -3
- package/dist/IDBKeyRange.d.ts.map +1 -1
- package/dist/IDBObjectStore.d.ts +22 -22
- package/dist/IDBObjectStore.d.ts.map +1 -1
- package/dist/IDBRequest.d.ts +2 -2
- package/dist/IDBRequest.d.ts.map +1 -1
- package/dist/IDBTransaction.d.ts +13 -13
- package/dist/IDBTransaction.d.ts.map +1 -1
- package/dist/Key.d.ts +14 -15
- package/dist/Key.d.ts.map +1 -1
- package/dist/Sca.d.ts +2 -2
- package/dist/Sca.d.ts.map +1 -1
- package/dist/cmp.d.ts +3 -3
- package/dist/cmp.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +36 -45
- 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 +229 -213
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +226 -240
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +3 -3
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +229 -213
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +226 -240
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +3 -3
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +226 -240
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +3 -3
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/nodeWebSQL.d.ts +2 -2
- package/dist/nodeWebSQL.d.ts.map +1 -1
- package/dist/setGlobalVars.d.ts +1 -2
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/dist/util.d.ts +20 -22
- package/dist/util.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/CFG.js +1 -1
- package/src/DOMException.js +8 -10
- package/src/DOMStringList.js +6 -11
- package/src/Event.js +1 -4
- package/src/IDBCursor.js +95 -47
- package/src/IDBFactory.js +8 -5
- package/src/IDBIndex.js +10 -12
- package/src/IDBKeyRange.js +6 -5
- package/src/IDBObjectStore.js +37 -32
- package/src/IDBRequest.js +1 -1
- package/src/IDBTransaction.js +11 -11
- package/src/IDBVersionChangeEvent.js +1 -4
- package/src/Key.js +32 -31
- package/src/Sca.js +1 -1
- package/src/cmp.js +2 -2
- package/src/nodeWebSQL.js +5 -2
- package/src/setGlobalVars.js +8 -19
- package/src/util.js +19 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim -
|
|
1
|
+
/*! indexeddbshim - v19.0.1 - 9/3/2026 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
// Callback not used by default
|
|
332
332
|
// Defaults to true except in Node builds where we can preserve literal NUL with better-sqlite3
|
|
333
333
|
'escapeNULForSQLiteStatements', 'sqlMemoryQuota', 'createIndexes'].forEach(function (prop) {
|
|
334
|
-
/** @type {(val:
|
|
334
|
+
/** @type {(val: ConfigValue) => void} */
|
|
335
335
|
var validator;
|
|
336
336
|
if (Array.isArray(prop)) {
|
|
337
337
|
var _prop = prop;
|
|
@@ -626,17 +626,12 @@
|
|
|
626
626
|
}
|
|
627
627
|
|
|
628
628
|
/**
|
|
629
|
-
* @
|
|
630
|
-
*/
|
|
631
|
-
|
|
632
|
-
/**
|
|
633
|
-
* @param {ArbitraryValue} obj
|
|
629
|
+
* @param {unknown} obj
|
|
634
630
|
* @returns {boolean}
|
|
635
631
|
*/
|
|
636
632
|
function isErrorOrDOMErrorOrDOMException(obj) {
|
|
637
|
-
return obj && _typeof(obj) === 'object' &&
|
|
638
633
|
// We don't use util.isObj here as mutual dependency causing problems in Babel with browser
|
|
639
|
-
typeof obj.name === 'string';
|
|
634
|
+
return _typeof(obj) === 'object' && obj !== null && 'name' in obj && typeof obj.name === 'string';
|
|
640
635
|
}
|
|
641
636
|
var test,
|
|
642
637
|
useNativeDOMException = false;
|
|
@@ -716,7 +711,7 @@
|
|
|
716
711
|
|
|
717
712
|
/**
|
|
718
713
|
*
|
|
719
|
-
* @param {
|
|
714
|
+
* @param {AnyValue} obj
|
|
720
715
|
* @returns {boolean}
|
|
721
716
|
*/
|
|
722
717
|
function isDate(obj) {
|
|
@@ -725,7 +720,7 @@
|
|
|
725
720
|
|
|
726
721
|
/**
|
|
727
722
|
*
|
|
728
|
-
* @param {
|
|
723
|
+
* @param {AnyValue} obj
|
|
729
724
|
* @returns {boolean}
|
|
730
725
|
*/
|
|
731
726
|
function isBlob(obj) {
|
|
@@ -734,7 +729,7 @@
|
|
|
734
729
|
|
|
735
730
|
/**
|
|
736
731
|
*
|
|
737
|
-
* @param {
|
|
732
|
+
* @param {AnyValue} obj
|
|
738
733
|
* @returns {boolean}
|
|
739
734
|
*/
|
|
740
735
|
function isFile(obj) {
|
|
@@ -763,8 +758,8 @@
|
|
|
763
758
|
|
|
764
759
|
/**
|
|
765
760
|
* Compares two keys.
|
|
766
|
-
* @param {import('./Key.js').Key} first
|
|
767
|
-
* @param {import('./Key.js').Key} second
|
|
761
|
+
* @param {import('./Key.js').Key|null|undefined} first
|
|
762
|
+
* @param {import('./Key.js').Key|null|undefined} second
|
|
768
763
|
* @returns {0|1|-1}
|
|
769
764
|
*/
|
|
770
765
|
function cmp(first, second) {
|
|
@@ -841,12 +836,11 @@
|
|
|
841
836
|
*/
|
|
842
837
|
|
|
843
838
|
/**
|
|
844
|
-
* @typedef {
|
|
839
|
+
* @typedef {unknown} Value
|
|
845
840
|
*/
|
|
846
841
|
|
|
847
842
|
/**
|
|
848
|
-
* @typedef {
|
|
849
|
-
* @todo Specify possible value more precisely
|
|
843
|
+
* @typedef {IDBValidKey} Key
|
|
850
844
|
*/
|
|
851
845
|
|
|
852
846
|
/**
|
|
@@ -913,15 +907,11 @@
|
|
|
913
907
|
*/
|
|
914
908
|
var signValues = ['negativeInfinity', 'bigNegative', 'smallNegative', 'smallPositive', 'bigPositive', 'positiveInfinity'];
|
|
915
909
|
|
|
916
|
-
/**
|
|
917
|
-
* @typedef {any} AnyValue
|
|
918
|
-
*/
|
|
919
|
-
|
|
920
910
|
/**
|
|
921
911
|
* @type {{
|
|
922
912
|
* [key: string]: {
|
|
923
|
-
* encode
|
|
924
|
-
* decode
|
|
913
|
+
* encode(param: unknown, inArray?: boolean): string,
|
|
914
|
+
* decode(param: string, inArray?: boolean): ValueType|undefined
|
|
925
915
|
* }
|
|
926
916
|
* }}
|
|
927
917
|
*/
|
|
@@ -1276,7 +1266,7 @@
|
|
|
1276
1266
|
}
|
|
1277
1267
|
|
|
1278
1268
|
/**
|
|
1279
|
-
* @param {
|
|
1269
|
+
* @param {Value} key
|
|
1280
1270
|
* @returns {KeyType|"invalid"}
|
|
1281
1271
|
*/
|
|
1282
1272
|
function getKeyType(key) {
|
|
@@ -1420,7 +1410,7 @@
|
|
|
1420
1410
|
case 'array':
|
|
1421
1411
|
{
|
|
1422
1412
|
// May throw (from binary)
|
|
1423
|
-
var arr = /** @type {
|
|
1413
|
+
var arr = /** @type {unknown[]} */input;
|
|
1424
1414
|
var len = arr.length;
|
|
1425
1415
|
safePush(seen, input);
|
|
1426
1416
|
|
|
@@ -1453,9 +1443,9 @@
|
|
|
1453
1443
|
};
|
|
1454
1444
|
}
|
|
1455
1445
|
if (!multiEntry || !fullKeys && keys.every(function (k) {
|
|
1456
|
-
return cmp(k, key.value) !== 0;
|
|
1446
|
+
return cmp(/** @type {Key} */k, /** @type {Key} */key.value) !== 0;
|
|
1457
1447
|
}) || fullKeys && keys.every(function (k) {
|
|
1458
|
-
return cmp(k, key) !== 0;
|
|
1448
|
+
return cmp(/** @type {Key} */k, /** @type {Key} */ /** @type {unknown} */key) !== 0;
|
|
1459
1449
|
})) {
|
|
1460
1450
|
safePush(keys, fullKeys ? key : key.value);
|
|
1461
1451
|
}
|
|
@@ -1512,7 +1502,7 @@
|
|
|
1512
1502
|
|
|
1513
1503
|
/**
|
|
1514
1504
|
*
|
|
1515
|
-
* @param {
|
|
1505
|
+
* @param {Value} key
|
|
1516
1506
|
* @param {boolean} [fullKeys]
|
|
1517
1507
|
* @returns {KeyValueObject}
|
|
1518
1508
|
* @todo Document other allowable `key`?
|
|
@@ -1627,7 +1617,7 @@
|
|
|
1627
1617
|
}
|
|
1628
1618
|
if (keyPath === '') {
|
|
1629
1619
|
return {
|
|
1630
|
-
value: value
|
|
1620
|
+
value: (/** @type {KeyPathEvaluateValueValue} */value)
|
|
1631
1621
|
};
|
|
1632
1622
|
}
|
|
1633
1623
|
var identifiers = keyPath.split('.');
|
|
@@ -1661,13 +1651,13 @@
|
|
|
1661
1651
|
}) ? {
|
|
1662
1652
|
failure: true
|
|
1663
1653
|
} : {
|
|
1664
|
-
value: value
|
|
1654
|
+
value: (/** @type {KeyPathEvaluateValueValue} */value)
|
|
1665
1655
|
};
|
|
1666
1656
|
}
|
|
1667
1657
|
|
|
1668
1658
|
/**
|
|
1669
1659
|
* Sets the inline key value.
|
|
1670
|
-
* @param {{[key: string]:
|
|
1660
|
+
* @param {{[key: string]: Value}} value
|
|
1671
1661
|
* @param {Key} key
|
|
1672
1662
|
* @param {string} keyPath
|
|
1673
1663
|
* @returns {void}
|
|
@@ -1685,7 +1675,7 @@
|
|
|
1685
1675
|
configurable: true
|
|
1686
1676
|
});
|
|
1687
1677
|
}
|
|
1688
|
-
value = value[identifier];
|
|
1678
|
+
value = /** @type {{[key: string]: Value}} */value[identifier];
|
|
1689
1679
|
});
|
|
1690
1680
|
Object.defineProperty(value, /** @type {string} */last, {
|
|
1691
1681
|
value: key,
|
|
@@ -1770,7 +1760,7 @@
|
|
|
1770
1760
|
* @returns {Key[]}
|
|
1771
1761
|
*/
|
|
1772
1762
|
function findMultiEntryMatches(keyEntry, range) {
|
|
1773
|
-
/** @type {
|
|
1763
|
+
/** @type {Key[]} */
|
|
1774
1764
|
var matches = [];
|
|
1775
1765
|
if (Array.isArray(keyEntry)) {
|
|
1776
1766
|
var _iterator4 = _createForOfIteratorHelper(keyEntry),
|
|
@@ -1809,7 +1799,7 @@
|
|
|
1809
1799
|
|
|
1810
1800
|
/**
|
|
1811
1801
|
* Not currently in use but keeping for spec parity.
|
|
1812
|
-
* @param {
|
|
1802
|
+
* @param {KeyValueObject} key
|
|
1813
1803
|
* @throws {Error} Upon a "bad key"
|
|
1814
1804
|
* @returns {ValueType}
|
|
1815
1805
|
*/
|
|
@@ -1820,16 +1810,17 @@
|
|
|
1820
1810
|
case 'number':
|
|
1821
1811
|
case 'string':
|
|
1822
1812
|
{
|
|
1823
|
-
return value;
|
|
1813
|
+
return /** @type {number|string} */value;
|
|
1824
1814
|
}
|
|
1825
1815
|
case 'array':
|
|
1826
1816
|
{
|
|
1827
1817
|
/** @type {ValueType[]} */
|
|
1828
1818
|
var array = [];
|
|
1829
|
-
var
|
|
1819
|
+
var arrValue = /** @type {KeyValueObject[]} */value;
|
|
1820
|
+
var len = arrValue.length;
|
|
1830
1821
|
var index = 0;
|
|
1831
1822
|
while (index < len) {
|
|
1832
|
-
var entry = convertKeyToValue(
|
|
1823
|
+
var entry = convertKeyToValue(arrValue[index]);
|
|
1833
1824
|
setArrayValue(array, index, entry);
|
|
1834
1825
|
index++;
|
|
1835
1826
|
}
|
|
@@ -1837,18 +1828,18 @@
|
|
|
1837
1828
|
}
|
|
1838
1829
|
case 'date':
|
|
1839
1830
|
{
|
|
1840
|
-
return new Date(value);
|
|
1831
|
+
return new Date(/** @type {number} */value);
|
|
1841
1832
|
}
|
|
1842
1833
|
case 'binary':
|
|
1843
1834
|
{
|
|
1844
|
-
var
|
|
1835
|
+
var binValue = /** @type {Uint8Array} */value;
|
|
1836
|
+
var _len = binValue.length;
|
|
1845
1837
|
var buffer = new ArrayBuffer(_len);
|
|
1846
1838
|
// Set the entries in buffer's [[ArrayBufferData]] to those in `value`
|
|
1847
|
-
var uint8 = new Uint8Array(buffer,
|
|
1848
|
-
uint8.set(
|
|
1839
|
+
var uint8 = new Uint8Array(buffer, binValue.byteOffset || 0, binValue.byteLength);
|
|
1840
|
+
uint8.set(binValue);
|
|
1849
1841
|
return buffer;
|
|
1850
1842
|
}
|
|
1851
|
-
case 'invalid':
|
|
1852
1843
|
default:
|
|
1853
1844
|
throw new Error('Bad key');
|
|
1854
1845
|
}
|
|
@@ -1856,7 +1847,7 @@
|
|
|
1856
1847
|
|
|
1857
1848
|
/**
|
|
1858
1849
|
*
|
|
1859
|
-
* @param {
|
|
1850
|
+
* @param {Value} key
|
|
1860
1851
|
* @param {boolean} [inArray]
|
|
1861
1852
|
* @returns {string|null}
|
|
1862
1853
|
*/
|
|
@@ -1871,7 +1862,7 @@
|
|
|
1871
1862
|
|
|
1872
1863
|
/**
|
|
1873
1864
|
*
|
|
1874
|
-
* @param {
|
|
1865
|
+
* @param {string|null} key
|
|
1875
1866
|
* @param {boolean} [inArray]
|
|
1876
1867
|
* @throws {Error} Invalid number
|
|
1877
1868
|
* @returns {undefined|ValueType}
|
|
@@ -1885,7 +1876,7 @@
|
|
|
1885
1876
|
|
|
1886
1877
|
/**
|
|
1887
1878
|
*
|
|
1888
|
-
* @param {
|
|
1879
|
+
* @param {Value} key
|
|
1889
1880
|
* @param {boolean} [inArray]
|
|
1890
1881
|
* @returns {undefined|ValueType}
|
|
1891
1882
|
*/
|