indexeddbshim 6.6.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/README.md +1 -6
- package/badges/coverage-badge.svg +1 -1
- package/badges/licenses-badge-dev.svg +1 -1
- package/badges/tests-badge.svg +1 -1
- package/dist/indexeddbshim-Key.js +34 -47
- 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.js +700 -570
- package/dist/indexeddbshim-UnicodeIdentifiers-node.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +735 -631
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +6 -6
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.js +700 -570
- package/dist/indexeddbshim-node.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +736 -632
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +6 -6
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +735 -631
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +6 -6
- package/dist/indexeddbshim.min.js.map +1 -1
- package/examples/IDBKeyUtils.html +0 -1
- package/index.html +5 -4
- package/package.json +58 -65
- package/src/DOMStringList.js +3 -3
- package/src/IDBDatabase.js +1 -1
- package/src/IDBObjectStore.js +3 -2
- package/src/IDBRequest.js +2 -2
- package/src/Key.js +9 -8
- package/src/unicode-regex.js +2 -2
- package/src/util.js +13 -18
- package/CHANGES.md +0 -1173
|
@@ -1,30 +1,50 @@
|
|
|
1
|
-
/*! indexeddbshim -
|
|
1
|
+
/*! indexeddbshim - v9.0.0 - 1/5/2022 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
6
|
-
(global = global || self, global.setGlobalVars = factory());
|
|
7
|
-
}(this, (function () { 'use strict';
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.setGlobalVars = factory());
|
|
7
|
+
})(this, (function () { 'use strict';
|
|
8
8
|
|
|
9
9
|
// ID_Start (includes Other_ID_Start)
|
|
10
10
|
var UnicodeIDStart = "(?:[$A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D])"; // ID_Continue (includes Other_ID_Continue)
|
|
11
11
|
|
|
12
12
|
var UnicodeIDContinue = "(?:[$0-9A-Z_a-z\\xAA\\xB5\\xB7\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1369-\\u1371\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF])";
|
|
13
13
|
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function ownKeys(object, enumerableOnly) {
|
|
15
|
+
var keys = Object.keys(object);
|
|
16
16
|
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_typeof = function (obj) {
|
|
23
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
24
|
-
};
|
|
17
|
+
if (Object.getOwnPropertySymbols) {
|
|
18
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
19
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
21
|
+
})), keys.push.apply(keys, symbols);
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
return
|
|
24
|
+
return keys;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _objectSpread2(target) {
|
|
28
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
29
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
30
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
31
|
+
_defineProperty(target, key, source[key]);
|
|
32
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
33
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return target;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _typeof$1(obj) {
|
|
41
|
+
"@babel/helpers - typeof";
|
|
42
|
+
|
|
43
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
44
|
+
return typeof obj;
|
|
45
|
+
} : function (obj) {
|
|
46
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
47
|
+
}, _typeof$1(obj);
|
|
28
48
|
}
|
|
29
49
|
|
|
30
50
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -46,6 +66,9 @@
|
|
|
46
66
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
47
67
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
48
68
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
69
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
70
|
+
writable: false
|
|
71
|
+
});
|
|
49
72
|
return Constructor;
|
|
50
73
|
}
|
|
51
74
|
|
|
@@ -87,40 +110,6 @@
|
|
|
87
110
|
return obj;
|
|
88
111
|
}
|
|
89
112
|
|
|
90
|
-
function ownKeys(object, enumerableOnly) {
|
|
91
|
-
var keys = Object.keys(object);
|
|
92
|
-
|
|
93
|
-
if (Object.getOwnPropertySymbols) {
|
|
94
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
95
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
96
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
97
|
-
});
|
|
98
|
-
keys.push.apply(keys, symbols);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return keys;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _objectSpread2(target) {
|
|
105
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
106
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
107
|
-
|
|
108
|
-
if (i % 2) {
|
|
109
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
110
|
-
_defineProperty(target, key, source[key]);
|
|
111
|
-
});
|
|
112
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
113
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
114
|
-
} else {
|
|
115
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
116
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return target;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
113
|
function _setPrototypeOf(o, p) {
|
|
125
114
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
126
115
|
o.__proto__ = p;
|
|
@@ -136,7 +125,7 @@
|
|
|
136
125
|
if (typeof Proxy === "function") return true;
|
|
137
126
|
|
|
138
127
|
try {
|
|
139
|
-
|
|
128
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
140
129
|
return true;
|
|
141
130
|
} catch (e) {
|
|
142
131
|
return false;
|
|
@@ -177,18 +166,21 @@
|
|
|
177
166
|
}
|
|
178
167
|
|
|
179
168
|
function _iterableToArray(iter) {
|
|
180
|
-
if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
169
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
181
170
|
}
|
|
182
171
|
|
|
183
172
|
function _iterableToArrayLimit(arr, i) {
|
|
184
|
-
|
|
173
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
174
|
+
|
|
175
|
+
if (_i == null) return;
|
|
185
176
|
var _arr = [];
|
|
186
177
|
var _n = true;
|
|
187
178
|
var _d = false;
|
|
188
|
-
|
|
179
|
+
|
|
180
|
+
var _s, _e;
|
|
189
181
|
|
|
190
182
|
try {
|
|
191
|
-
for (
|
|
183
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
192
184
|
_arr.push(_s.value);
|
|
193
185
|
|
|
194
186
|
if (i && _arr.length === i) break;
|
|
@@ -233,9 +225,9 @@
|
|
|
233
225
|
}
|
|
234
226
|
|
|
235
227
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
236
|
-
var it;
|
|
228
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
237
229
|
|
|
238
|
-
if (
|
|
230
|
+
if (!it) {
|
|
239
231
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
240
232
|
if (it) o = it;
|
|
241
233
|
var i = 0;
|
|
@@ -268,7 +260,7 @@
|
|
|
268
260
|
err;
|
|
269
261
|
return {
|
|
270
262
|
s: function () {
|
|
271
|
-
it =
|
|
263
|
+
it = it.call(o);
|
|
272
264
|
},
|
|
273
265
|
n: function () {
|
|
274
266
|
var step = it.next();
|
|
@@ -289,24 +281,24 @@
|
|
|
289
281
|
};
|
|
290
282
|
}
|
|
291
283
|
|
|
292
|
-
var global$1 = typeof global$2 !== "undefined" ? global$2 : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
293
|
-
|
|
294
284
|
var global$2 = typeof global$1 !== "undefined" ? global$1 : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
295
285
|
|
|
296
|
-
|
|
286
|
+
var global$1 = typeof global$2 !== "undefined" ? global$2 : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
287
|
+
|
|
288
|
+
function _typeof(obj) {
|
|
297
289
|
"@babel/helpers - typeof";
|
|
298
290
|
|
|
299
291
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
300
|
-
_typeof
|
|
292
|
+
_typeof = function _typeof(obj) {
|
|
301
293
|
return typeof obj;
|
|
302
294
|
};
|
|
303
295
|
} else {
|
|
304
|
-
_typeof
|
|
296
|
+
_typeof = function _typeof(obj) {
|
|
305
297
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
306
298
|
};
|
|
307
299
|
}
|
|
308
300
|
|
|
309
|
-
return _typeof
|
|
301
|
+
return _typeof(obj);
|
|
310
302
|
}
|
|
311
303
|
/* eslint-disable no-sync, no-restricted-syntax */
|
|
312
304
|
// Todo: Switch to ES6 classes
|
|
@@ -318,7 +310,7 @@
|
|
|
318
310
|
AT_TARGET: 2,
|
|
319
311
|
BUBBLING_PHASE: 3
|
|
320
312
|
};
|
|
321
|
-
var ShimDOMException = typeof DOMException === 'undefined' // Todo: Better polyfill (if even needed here)
|
|
313
|
+
var ShimDOMException$1 = typeof DOMException === 'undefined' // Todo: Better polyfill (if even needed here)
|
|
322
314
|
// eslint-disable-next-line no-shadow
|
|
323
315
|
? function DOMException(msg, name) {
|
|
324
316
|
// No need for `toString` as same as for `Error`
|
|
@@ -702,7 +694,7 @@
|
|
|
702
694
|
if (arguments.length < 2) throw new TypeError('2 or more arguments required');
|
|
703
695
|
|
|
704
696
|
if (typeof type !== 'string') {
|
|
705
|
-
throw new ShimDOMException('UNSPECIFIED_EVENT_TYPE_ERR', 'UNSPECIFIED_EVENT_TYPE_ERR');
|
|
697
|
+
throw new ShimDOMException$1('UNSPECIFIED_EVENT_TYPE_ERR', 'UNSPECIFIED_EVENT_TYPE_ERR');
|
|
706
698
|
}
|
|
707
699
|
|
|
708
700
|
try {
|
|
@@ -763,7 +755,7 @@
|
|
|
763
755
|
var _evCfg = evCfg.get(e);
|
|
764
756
|
|
|
765
757
|
if (_evCfg && setTarget && _evCfg._dispatched) {
|
|
766
|
-
throw new ShimDOMException('The object is in an invalid state.', 'InvalidStateError');
|
|
758
|
+
throw new ShimDOMException$1('The object is in an invalid state.', 'InvalidStateError');
|
|
767
759
|
}
|
|
768
760
|
|
|
769
761
|
var eventCopy;
|
|
@@ -1005,7 +997,7 @@
|
|
|
1005
997
|
var triggerGlobalErrorEvent;
|
|
1006
998
|
var useNodeImpl = false;
|
|
1007
999
|
|
|
1008
|
-
if (typeof window === 'undefined' || typeof ErrorEvent === 'undefined' || window && (typeof window === "undefined" ? "undefined" : _typeof
|
|
1000
|
+
if (typeof window === 'undefined' || typeof ErrorEvent === 'undefined' || window && (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && !window.dispatchEvent) {
|
|
1009
1001
|
useNodeImpl = true;
|
|
1010
1002
|
|
|
1011
1003
|
triggerGlobalErrorEvent = function triggerGlobalErrorEvent() {
|
|
@@ -1074,7 +1066,7 @@
|
|
|
1074
1066
|
};
|
|
1075
1067
|
EventTarget.ShimEvent = ShimEvent;
|
|
1076
1068
|
EventTarget.ShimCustomEvent = ShimCustomEvent;
|
|
1077
|
-
EventTarget.ShimDOMException = ShimDOMException;
|
|
1069
|
+
EventTarget.ShimDOMException = ShimDOMException$1;
|
|
1078
1070
|
EventTarget.ShimEventTarget = EventTarget;
|
|
1079
1071
|
EventTarget.EventTargetFactory = EventTargetFactory;
|
|
1080
1072
|
/**
|
|
@@ -1087,7 +1079,7 @@
|
|
|
1087
1079
|
Object.setPrototypeOf(ShimCustomEvent.prototype, ShimEvent.prototype);
|
|
1088
1080
|
} // Todo: Move to own library (but allowing WeakMaps to be passed in for sharing here)
|
|
1089
1081
|
|
|
1090
|
-
var map = {};
|
|
1082
|
+
var map$1 = {};
|
|
1091
1083
|
var CFG = {};
|
|
1092
1084
|
[// Boolean for verbose reporting
|
|
1093
1085
|
'DEBUG', // Effectively defaults to false (ignored unless `true`)
|
|
@@ -1173,7 +1165,7 @@
|
|
|
1173
1165
|
// defaults to `true`
|
|
1174
1166
|
'addSQLiteExtension', // Various types of in-memory databases that can auto-delete
|
|
1175
1167
|
['memoryDatabase', function (val) {
|
|
1176
|
-
if (!/^(?::memory:|file::memory:(\?(?:
|
|
1168
|
+
if (!/^(?::memory:|file::memory:(\?(?:(?!#)[\s\S])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test(val)) {
|
|
1177
1169
|
throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a ' + '"file::memory:[?queryString][#hash] URL".');
|
|
1178
1170
|
}
|
|
1179
1171
|
}], // NODE-SPECIFIC CONFIG
|
|
@@ -1197,30 +1189,30 @@
|
|
|
1197
1189
|
|
|
1198
1190
|
Object.defineProperty(CFG, prop, {
|
|
1199
1191
|
get: function get() {
|
|
1200
|
-
return map[prop];
|
|
1192
|
+
return map$1[prop];
|
|
1201
1193
|
},
|
|
1202
1194
|
set: function set(val) {
|
|
1203
1195
|
if (validator) {
|
|
1204
1196
|
validator(val);
|
|
1205
1197
|
}
|
|
1206
1198
|
|
|
1207
|
-
map[prop] = val;
|
|
1199
|
+
map$1[prop] = val;
|
|
1208
1200
|
}
|
|
1209
1201
|
});
|
|
1210
1202
|
});
|
|
1211
1203
|
|
|
1212
|
-
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]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/;
|
|
1204
|
+
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]/;
|
|
1213
1205
|
|
|
1214
1206
|
function escapeUnmatchedSurrogates(arg) {
|
|
1215
1207
|
// http://stackoverflow.com/a/6701665/271577
|
|
1216
|
-
return arg.replace(/((?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])))(?!(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(^|(?:[\
|
|
1208
|
+
return arg.replace(/((?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])))(?!(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(^|(?:(?)[\s\S]))((?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g, function (_, unmatchedHighSurrogate, precedingLow, unmatchedLowSurrogate) {
|
|
1217
1209
|
// Could add a corresponding surrogate for compatibility with `node-sqlite3`: http://bugs.python.org/issue12569 and http://stackoverflow.com/a/6701665/271577
|
|
1218
1210
|
// but Chrome having problems
|
|
1219
1211
|
if (unmatchedHighSurrogate) {
|
|
1220
|
-
return '^2' +
|
|
1212
|
+
return '^2' + unmatchedHighSurrogate.codePointAt().toString(16).padStart(4, '0');
|
|
1221
1213
|
}
|
|
1222
1214
|
|
|
1223
|
-
return (precedingLow || '') + '^3' +
|
|
1215
|
+
return (precedingLow || '') + '^3' + unmatchedLowSurrogate.codePointAt().toString(16).padStart(4, '0');
|
|
1224
1216
|
});
|
|
1225
1217
|
}
|
|
1226
1218
|
|
|
@@ -1272,18 +1264,16 @@
|
|
|
1272
1264
|
|
|
1273
1265
|
if (CFG.escapeNFDForDatabaseNames !== false) {
|
|
1274
1266
|
// ES6 copying of regex with different flags
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
// https://github.com/axemclion/IndexedDBShim/issues/311#issuecomment-316090147 )
|
|
1278
|
-
db = db.replace(new RegExp(regex.source, 'gu'), function (expandable) {
|
|
1279
|
-
return '^4' + padStart(expandable.codePointAt().toString(16), 6, '0');
|
|
1267
|
+
db = db.replace(new RegExp(regex, 'gu'), function (expandable) {
|
|
1268
|
+
return '^4' + expandable.codePointAt().toString(16).padStart(6, '0');
|
|
1280
1269
|
});
|
|
1281
1270
|
}
|
|
1282
1271
|
|
|
1283
1272
|
if (CFG.databaseCharacterEscapeList !== false) {
|
|
1284
1273
|
db = db.replace(CFG.databaseCharacterEscapeList ? new RegExp(CFG.databaseCharacterEscapeList, 'gu') : /[\0-\x1F"\*\/:<>\?\\\|\x7F]/g, // eslint-disable-line no-control-regex
|
|
1285
1274
|
function (n0) {
|
|
1286
|
-
|
|
1275
|
+
// eslint-disable-next-line unicorn/prefer-code-point -- Switch to `codePointAt`?
|
|
1276
|
+
return '^1' + n0.charCodeAt().toString(16).padStart(2, '0');
|
|
1287
1277
|
});
|
|
1288
1278
|
}
|
|
1289
1279
|
|
|
@@ -1298,9 +1288,9 @@
|
|
|
1298
1288
|
|
|
1299
1289
|
function unescapeUnmatchedSurrogates(arg) {
|
|
1300
1290
|
return arg.replace(/(\^+)3(d[0-9a-f]{3})/g, function (_, esc, lowSurr) {
|
|
1301
|
-
return esc.length % 2 ? esc.slice(1) + String.
|
|
1291
|
+
return esc.length % 2 ? esc.slice(1) + String.fromCodePoint(Number.parseInt(lowSurr, 16)) : _;
|
|
1302
1292
|
}).replace(/(\^+)2(d[0-9a-f]{3})/g, function (_, esc, highSurr) {
|
|
1303
|
-
return esc.length % 2 ? esc.slice(1) + String.
|
|
1293
|
+
return esc.length % 2 ? esc.slice(1) + String.fromCodePoint(Number.parseInt(highSurr, 16)) : _;
|
|
1304
1294
|
});
|
|
1305
1295
|
} // Not in use internally but supplied for convenience
|
|
1306
1296
|
|
|
@@ -1327,7 +1317,7 @@
|
|
|
1327
1317
|
}
|
|
1328
1318
|
|
|
1329
1319
|
function isObj(obj) {
|
|
1330
|
-
return obj && _typeof(obj) === 'object';
|
|
1320
|
+
return obj && _typeof$1(obj) === 'object';
|
|
1331
1321
|
}
|
|
1332
1322
|
|
|
1333
1323
|
function isDate(obj) {
|
|
@@ -1515,12 +1505,7 @@
|
|
|
1515
1505
|
}
|
|
1516
1506
|
|
|
1517
1507
|
function hasOwn(obj, prop) {
|
|
1518
|
-
return
|
|
1519
|
-
} // Todo: Replace with `String.prototype.padStart` when targeting supporting Node version
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
function padStart(str, ct, fill) {
|
|
1523
|
-
return new Array(ct - String(str).length + 1).join(fill) + str;
|
|
1508
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1524
1509
|
}
|
|
1525
1510
|
|
|
1526
1511
|
/**
|
|
@@ -1544,7 +1529,7 @@
|
|
|
1544
1529
|
}
|
|
1545
1530
|
});
|
|
1546
1531
|
|
|
1547
|
-
var readonlyProperties = ['oldVersion', 'newVersion']; // Babel apparently having a problem adding `hasInstance` to a class, so we are redefining as a function
|
|
1532
|
+
var readonlyProperties$6 = ['oldVersion', 'newVersion']; // Babel apparently having a problem adding `hasInstance` to a class, so we are redefining as a function
|
|
1548
1533
|
|
|
1549
1534
|
function IDBVersionChangeEvent(type
|
|
1550
1535
|
/* , eventInitDict */
|
|
@@ -1563,7 +1548,7 @@
|
|
|
1563
1548
|
|
|
1564
1549
|
IDBVersionChangeEvent.prototype = Object.create(ShimEvent.prototype);
|
|
1565
1550
|
IDBVersionChangeEvent.prototype[Symbol.toStringTag] = 'IDBVersionChangeEventPrototype';
|
|
1566
|
-
readonlyProperties.forEach(function (prop) {
|
|
1551
|
+
readonlyProperties$6.forEach(function (prop) {
|
|
1567
1552
|
var _o, _mutatorMap;
|
|
1568
1553
|
|
|
1569
1554
|
// Ensure for proper interface testing that "get <name>" is the function name
|
|
@@ -1807,7 +1792,7 @@
|
|
|
1807
1792
|
}
|
|
1808
1793
|
|
|
1809
1794
|
function isErrorOrDOMErrorOrDOMException(obj) {
|
|
1810
|
-
return obj && _typeof(obj) === 'object' && // We don't use util.isObj here as mutual dependency causing problems in Babel with browser
|
|
1795
|
+
return obj && _typeof$1(obj) === 'object' && // We don't use util.isObj here as mutual dependency causing problems in Babel with browser
|
|
1811
1796
|
typeof obj.name === 'string';
|
|
1812
1797
|
}
|
|
1813
1798
|
/**
|
|
@@ -1913,10 +1898,10 @@
|
|
|
1913
1898
|
logError(name, message, error);
|
|
1914
1899
|
return createNonNativeDOMException(name, message);
|
|
1915
1900
|
};
|
|
1916
|
-
var ShimDOMException
|
|
1901
|
+
var ShimDOMException = useNativeDOMException ? DOMException : ShimNonNativeDOMException;
|
|
1917
1902
|
|
|
1918
|
-
var listeners = ['onsuccess', 'onerror'];
|
|
1919
|
-
var readonlyProperties$
|
|
1903
|
+
var listeners$2 = ['onsuccess', 'onerror'];
|
|
1904
|
+
var readonlyProperties$5 = ['source', 'transaction', 'readyState'];
|
|
1920
1905
|
var doneFlagGetters = ['result', 'error'];
|
|
1921
1906
|
/**
|
|
1922
1907
|
* The IDBRequest Object that is returns for all async calls.
|
|
@@ -1930,6 +1915,8 @@
|
|
|
1930
1915
|
|
|
1931
1916
|
|
|
1932
1917
|
IDBRequest.__super = function IDBRequest() {
|
|
1918
|
+
var _this = this;
|
|
1919
|
+
|
|
1933
1920
|
this[Symbol.toStringTag] = 'IDBRequest';
|
|
1934
1921
|
|
|
1935
1922
|
this.__setOptions({
|
|
@@ -1938,12 +1925,12 @@
|
|
|
1938
1925
|
});
|
|
1939
1926
|
|
|
1940
1927
|
doneFlagGetters.forEach(function (prop) {
|
|
1941
|
-
Object.defineProperty(
|
|
1928
|
+
Object.defineProperty(_this, '__' + prop, {
|
|
1942
1929
|
enumerable: false,
|
|
1943
1930
|
configurable: false,
|
|
1944
1931
|
writable: true
|
|
1945
1932
|
});
|
|
1946
|
-
Object.defineProperty(
|
|
1933
|
+
Object.defineProperty(_this, prop, {
|
|
1947
1934
|
enumerable: true,
|
|
1948
1935
|
configurable: true,
|
|
1949
1936
|
get: function get() {
|
|
@@ -1954,8 +1941,8 @@
|
|
|
1954
1941
|
return this['__' + prop];
|
|
1955
1942
|
}
|
|
1956
1943
|
});
|
|
1957
|
-
}
|
|
1958
|
-
defineReadonlyProperties(this, readonlyProperties$
|
|
1944
|
+
});
|
|
1945
|
+
defineReadonlyProperties(this, readonlyProperties$5, {
|
|
1959
1946
|
readyState: {
|
|
1960
1947
|
get readyState() {
|
|
1961
1948
|
return this.__done ? 'done' : 'pending';
|
|
@@ -1963,7 +1950,7 @@
|
|
|
1963
1950
|
|
|
1964
1951
|
}
|
|
1965
1952
|
});
|
|
1966
|
-
defineListenerProperties(this, listeners);
|
|
1953
|
+
defineListenerProperties(this, listeners$2);
|
|
1967
1954
|
this.__result = undefined;
|
|
1968
1955
|
this.__error = this.__source = this.__transaction = null;
|
|
1969
1956
|
this.__done = false;
|
|
@@ -1987,9 +1974,9 @@
|
|
|
1987
1974
|
}; // Illegal invocations
|
|
1988
1975
|
|
|
1989
1976
|
|
|
1990
|
-
defineReadonlyOuterInterface(IDBRequest.prototype, readonlyProperties$
|
|
1977
|
+
defineReadonlyOuterInterface(IDBRequest.prototype, readonlyProperties$5);
|
|
1991
1978
|
defineReadonlyOuterInterface(IDBRequest.prototype, doneFlagGetters);
|
|
1992
|
-
defineOuterInterface(IDBRequest.prototype, listeners);
|
|
1979
|
+
defineOuterInterface(IDBRequest.prototype, listeners$2);
|
|
1993
1980
|
Object.defineProperty(IDBRequest.prototype, 'constructor', {
|
|
1994
1981
|
enumerable: false,
|
|
1995
1982
|
writable: true,
|
|
@@ -2045,9 +2032,11 @@
|
|
|
2045
2032
|
writable: false
|
|
2046
2033
|
});
|
|
2047
2034
|
|
|
2048
|
-
|
|
2035
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2036
|
+
|
|
2049
2037
|
// not doing the trick for our WebSQL transactions (at least in Node),
|
|
2050
2038
|
// we are forced to make the promises run fully synchronously.
|
|
2039
|
+
|
|
2051
2040
|
function isPromise(p) {
|
|
2052
2041
|
return p && typeof p.then === 'function';
|
|
2053
2042
|
}
|
|
@@ -2231,12 +2220,12 @@
|
|
|
2231
2220
|
var decodedKey1 = _decode(encodedKey1);
|
|
2232
2221
|
var decodedKey2 = _decode(encodedKey2);
|
|
2233
2222
|
|
|
2234
|
-
if (_typeof(first) === 'object') {
|
|
2223
|
+
if (_typeof$1(first) === 'object') {
|
|
2235
2224
|
first = JSON.stringify(first);
|
|
2236
2225
|
decodedKey1 = JSON.stringify(decodedKey1);
|
|
2237
2226
|
}
|
|
2238
2227
|
|
|
2239
|
-
if (_typeof(second) === 'object') {
|
|
2228
|
+
if (_typeof$1(second) === 'object') {
|
|
2240
2229
|
second = JSON.stringify(second);
|
|
2241
2230
|
decodedKey2 = JSON.stringify(decodedKey2);
|
|
2242
2231
|
} // Encoding/decoding mismatches are usually due to a loss of
|
|
@@ -2274,7 +2263,7 @@
|
|
|
2274
2263
|
};
|
|
2275
2264
|
var keyTypes = Object.keys(keyTypeToEncodedChar);
|
|
2276
2265
|
keyTypes.forEach(function (k) {
|
|
2277
|
-
keyTypeToEncodedChar[k] = String.
|
|
2266
|
+
keyTypeToEncodedChar[k] = String.fromCodePoint(keyTypeToEncodedChar[k]);
|
|
2278
2267
|
});
|
|
2279
2268
|
var encodedCharToKeyType = keyTypes.reduce(function (o, k) {
|
|
2280
2269
|
o[keyTypeToEncodedChar[k]] = k;
|
|
@@ -2324,7 +2313,7 @@
|
|
|
2324
2313
|
|
|
2325
2314
|
key32 = decimalIndex !== -1 ? key32.replace('.', '') : key32; // Get the index of the first significant digit.
|
|
2326
2315
|
|
|
2327
|
-
var significantDigitIndex = key32.search(/(?:
|
|
2316
|
+
var significantDigitIndex = key32.search(/(?:(?!0)[\s\S])/); // Truncate leading zeros.
|
|
2328
2317
|
|
|
2329
2318
|
key32 = key32.slice(significantDigitIndex);
|
|
2330
2319
|
var sign, exponent, mantissa; // Finite cases:
|
|
@@ -2372,10 +2361,10 @@
|
|
|
2372
2361
|
|
|
2373
2362
|
switch (signValues[sign]) {
|
|
2374
2363
|
case 'negativeInfinity':
|
|
2375
|
-
return
|
|
2364
|
+
return Number.NEGATIVE_INFINITY;
|
|
2376
2365
|
|
|
2377
2366
|
case 'positiveInfinity':
|
|
2378
|
-
return
|
|
2367
|
+
return Number.POSITIVE_INFINITY;
|
|
2379
2368
|
|
|
2380
2369
|
case 'bigPositive':
|
|
2381
2370
|
return pow32(mantissa, exponent);
|
|
@@ -2487,7 +2476,7 @@
|
|
|
2487
2476
|
// `ArrayBuffer`/Views on buffers (`TypedArray` or `DataView`)
|
|
2488
2477
|
encode: function encode(key) {
|
|
2489
2478
|
return keyTypeToEncodedChar.binary + '-' + (key.byteLength ? _toConsumableArray(getCopyBytesHeldByBufferSource(key)).map(function (b) {
|
|
2490
|
-
return padStart(
|
|
2479
|
+
return String(b).padStart(3, '0');
|
|
2491
2480
|
}) // e.g., '255,005,254,000,001,033'
|
|
2492
2481
|
: '');
|
|
2493
2482
|
},
|
|
@@ -2584,13 +2573,13 @@
|
|
|
2584
2573
|
}
|
|
2585
2574
|
/**
|
|
2586
2575
|
* @param {Float} num
|
|
2587
|
-
* @param {Float} precision
|
|
2576
|
+
* @param {Float} [precision=16]
|
|
2588
2577
|
* @returns {Float}
|
|
2589
2578
|
*/
|
|
2590
2579
|
|
|
2591
2580
|
|
|
2592
|
-
function roundToPrecision(num
|
|
2593
|
-
precision =
|
|
2581
|
+
function roundToPrecision(num) {
|
|
2582
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
|
|
2594
2583
|
return Number.parseFloat(num.toPrecision(precision));
|
|
2595
2584
|
}
|
|
2596
2585
|
/**
|
|
@@ -2628,7 +2617,7 @@
|
|
|
2628
2617
|
if (isDate(key)) return 'date';
|
|
2629
2618
|
if (isBinary(key)) return 'binary';
|
|
2630
2619
|
|
|
2631
|
-
var keyType = _typeof(key);
|
|
2620
|
+
var keyType = _typeof$1(key);
|
|
2632
2621
|
|
|
2633
2622
|
return ['string', 'number'].includes(keyType) ? keyType : 'invalid';
|
|
2634
2623
|
}
|
|
@@ -2802,13 +2791,8 @@
|
|
|
2802
2791
|
}
|
|
2803
2792
|
}();
|
|
2804
2793
|
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
continue;
|
|
2808
|
-
|
|
2809
|
-
default:
|
|
2810
|
-
if (_typeof(_ret) === "object") return _ret.v;
|
|
2811
|
-
}
|
|
2794
|
+
if (_ret === "continue") continue;
|
|
2795
|
+
if (_typeof$1(_ret) === "object") return _ret.v;
|
|
2812
2796
|
} catch (err) {
|
|
2813
2797
|
if (!multiEntry) {
|
|
2814
2798
|
throw err;
|
|
@@ -2846,7 +2830,7 @@
|
|
|
2846
2830
|
{
|
|
2847
2831
|
// Other `typeof` types which are not valid keys:
|
|
2848
2832
|
// 'undefined', 'boolean', 'object' (including `null`), 'symbol', 'function
|
|
2849
|
-
var _type = input === null ? 'null' : _typeof(input); // Convert `null` for convenience of consumers in reporting errors
|
|
2833
|
+
var _type = input === null ? 'null' : _typeof$1(input); // Convert `null` for convenience of consumers in reporting errors
|
|
2850
2834
|
|
|
2851
2835
|
|
|
2852
2836
|
return {
|
|
@@ -3403,7 +3387,7 @@
|
|
|
3403
3387
|
getCurrentNumber(tx, store, function (key) {
|
|
3404
3388
|
if (key > MAX_ALLOWED_CURRENT_NUMBER) {
|
|
3405
3389
|
// 2 ^ 53 (See <https://github.com/w3c/IndexedDB/issues/147>)
|
|
3406
|
-
cb('failure'); // eslint-disable-line
|
|
3390
|
+
cb('failure'); // eslint-disable-line node/no-callback-literal
|
|
3407
3391
|
|
|
3408
3392
|
return;
|
|
3409
3393
|
} // Increment current number by 1 (we cannot leverage SQLite's
|
|
@@ -3484,7 +3468,7 @@
|
|
|
3484
3468
|
possiblyUpdateKeyGenerator: possiblyUpdateKeyGenerator
|
|
3485
3469
|
});
|
|
3486
3470
|
|
|
3487
|
-
var readonlyProperties$
|
|
3471
|
+
var readonlyProperties$4 = ['lower', 'upper', 'lowerOpen', 'upperOpen'];
|
|
3488
3472
|
/* eslint-disable jsdoc/check-param-names */
|
|
3489
3473
|
|
|
3490
3474
|
/**
|
|
@@ -3599,7 +3583,7 @@
|
|
|
3599
3583
|
};
|
|
3600
3584
|
|
|
3601
3585
|
IDBKeyRange.prototype[Symbol.toStringTag] = 'IDBKeyRangePrototype';
|
|
3602
|
-
readonlyProperties$
|
|
3586
|
+
readonlyProperties$4.forEach(function (prop) {
|
|
3603
3587
|
var _o, _mutatorMap;
|
|
3604
3588
|
|
|
3605
3589
|
Object.defineProperty(IDBKeyRange.prototype, '__' + prop, {
|
|
@@ -3761,11 +3745,11 @@
|
|
|
3761
3745
|
return this._items;
|
|
3762
3746
|
},
|
|
3763
3747
|
forEach: function forEach(cb, thisArg) {
|
|
3764
|
-
// eslint-disable-next-line unicorn/no-
|
|
3748
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
|
|
3765
3749
|
this._items.forEach(cb, thisArg);
|
|
3766
3750
|
},
|
|
3767
3751
|
map: function map(cb, thisArg) {
|
|
3768
|
-
// eslint-disable-next-line unicorn/no-
|
|
3752
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
|
|
3769
3753
|
return this._items.map(cb, thisArg);
|
|
3770
3754
|
},
|
|
3771
3755
|
indexOf: function indexOf(str) {
|
|
@@ -3777,9 +3761,7 @@
|
|
|
3777
3761
|
this._length++;
|
|
3778
3762
|
this.sortList();
|
|
3779
3763
|
},
|
|
3780
|
-
splice: function splice()
|
|
3781
|
-
/* index, howmany, item1, ..., itemX */
|
|
3782
|
-
{
|
|
3764
|
+
splice: function splice() {
|
|
3783
3765
|
var _this$_items;
|
|
3784
3766
|
|
|
3785
3767
|
(_this$_items = this._items).splice.apply(_this$_items, arguments);
|
|
@@ -3824,7 +3806,7 @@
|
|
|
3824
3806
|
})), _DOMStringList$protot);
|
|
3825
3807
|
Object.defineProperty(DOMStringList, Symbol.hasInstance, {
|
|
3826
3808
|
value: function value(obj) {
|
|
3827
|
-
return
|
|
3809
|
+
return Object.prototype.toString.call(obj) === 'DOMStringListPrototype';
|
|
3828
3810
|
}
|
|
3829
3811
|
});
|
|
3830
3812
|
var DOMStringListAlias = DOMStringList;
|
|
@@ -3998,9 +3980,7 @@
|
|
|
3998
3980
|
executeNextRequest();
|
|
3999
3981
|
}
|
|
4000
3982
|
|
|
4001
|
-
function error()
|
|
4002
|
-
/* tx, err */
|
|
4003
|
-
{
|
|
3983
|
+
function error() {
|
|
4004
3984
|
if (me.__errored || me.__requestsFinished) {
|
|
4005
3985
|
// We've already called "onerror", "onabort", or thrown within
|
|
4006
3986
|
// the transaction, so don't do it again.
|
|
@@ -4326,8 +4306,8 @@
|
|
|
4326
4306
|
// Store was already created so we restore to name before the rename
|
|
4327
4307
|
if ('__pendingName' in store && me.db.__oldObjectStoreNames.indexOf(store.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes
|
|
4328
4308
|
) {
|
|
4329
|
-
|
|
4330
|
-
|
|
4309
|
+
store.__name = store.__originalName;
|
|
4310
|
+
}
|
|
4331
4311
|
|
|
4332
4312
|
store.__indexNames = store.__oldIndexNames;
|
|
4333
4313
|
delete store.__pendingDelete;
|
|
@@ -4335,8 +4315,8 @@
|
|
|
4335
4315
|
// Index was already created so we restore to name before the rename
|
|
4336
4316
|
if ('__pendingName' in index && store.__oldIndexNames.indexOf(index.__pendingName) > -1 // eslint-disable-line unicorn/prefer-includes
|
|
4337
4317
|
) {
|
|
4338
|
-
|
|
4339
|
-
|
|
4318
|
+
index.__name = index.__originalName;
|
|
4319
|
+
}
|
|
4340
4320
|
|
|
4341
4321
|
delete index.__pendingDelete;
|
|
4342
4322
|
});
|
|
@@ -4518,75 +4498,27 @@
|
|
|
4518
4498
|
writable: false
|
|
4519
4499
|
});
|
|
4520
4500
|
|
|
4521
|
-
var
|
|
4522
|
-
|
|
4523
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
4524
|
-
return module = {
|
|
4525
|
-
path: basedir,
|
|
4526
|
-
exports: {},
|
|
4527
|
-
require: function (path, base) {
|
|
4528
|
-
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
4529
|
-
}
|
|
4530
|
-
}, fn(module, module.exports), module.exports;
|
|
4531
|
-
}
|
|
4532
|
-
|
|
4533
|
-
function commonjsRequire () {
|
|
4534
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
4535
|
-
}
|
|
4501
|
+
var typeson$1 = {exports: {}};
|
|
4536
4502
|
|
|
4537
|
-
|
|
4503
|
+
(function (module, exports) {
|
|
4538
4504
|
(function (global, factory) {
|
|
4539
|
-
|
|
4505
|
+
module.exports = factory() ;
|
|
4540
4506
|
})(commonjsGlobal, function () {
|
|
4541
4507
|
|
|
4542
|
-
function _typeof
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4508
|
+
function _typeof(obj) {
|
|
4509
|
+
"@babel/helpers - typeof";
|
|
4510
|
+
|
|
4511
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
4512
|
+
_typeof = function _typeof(obj) {
|
|
4513
|
+
return typeof obj;
|
|
4546
4514
|
};
|
|
4547
4515
|
} else {
|
|
4548
|
-
_typeof
|
|
4549
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" :
|
|
4516
|
+
_typeof = function _typeof(obj) {
|
|
4517
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
4550
4518
|
};
|
|
4551
4519
|
}
|
|
4552
4520
|
|
|
4553
|
-
return _typeof
|
|
4554
|
-
}
|
|
4555
|
-
|
|
4556
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4557
|
-
try {
|
|
4558
|
-
var info = gen[key](arg);
|
|
4559
|
-
var value = info.value;
|
|
4560
|
-
} catch (error) {
|
|
4561
|
-
reject(error);
|
|
4562
|
-
return;
|
|
4563
|
-
}
|
|
4564
|
-
|
|
4565
|
-
if (info.done) {
|
|
4566
|
-
resolve(value);
|
|
4567
|
-
} else {
|
|
4568
|
-
Promise.resolve(value).then(_next, _throw);
|
|
4569
|
-
}
|
|
4570
|
-
}
|
|
4571
|
-
|
|
4572
|
-
function _asyncToGenerator(fn) {
|
|
4573
|
-
return function () {
|
|
4574
|
-
var self = this,
|
|
4575
|
-
args = arguments;
|
|
4576
|
-
return new Promise(function (resolve, reject) {
|
|
4577
|
-
var gen = fn.apply(self, args);
|
|
4578
|
-
|
|
4579
|
-
function _next(value) {
|
|
4580
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
4581
|
-
}
|
|
4582
|
-
|
|
4583
|
-
function _throw(err) {
|
|
4584
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4585
|
-
}
|
|
4586
|
-
|
|
4587
|
-
_next(undefined);
|
|
4588
|
-
});
|
|
4589
|
-
};
|
|
4521
|
+
return _typeof(obj);
|
|
4590
4522
|
}
|
|
4591
4523
|
|
|
4592
4524
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -4661,21 +4593,15 @@
|
|
|
4661
4593
|
}
|
|
4662
4594
|
|
|
4663
4595
|
function _slicedToArray(arr, i) {
|
|
4664
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
|
4596
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
4665
4597
|
}
|
|
4666
4598
|
|
|
4667
4599
|
function _toConsumableArray(arr) {
|
|
4668
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
4600
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
4669
4601
|
}
|
|
4670
4602
|
|
|
4671
4603
|
function _arrayWithoutHoles(arr) {
|
|
4672
|
-
if (Array.isArray(arr))
|
|
4673
|
-
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
|
4674
|
-
arr2[i] = arr[i];
|
|
4675
|
-
}
|
|
4676
|
-
|
|
4677
|
-
return arr2;
|
|
4678
|
-
}
|
|
4604
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
4679
4605
|
}
|
|
4680
4606
|
|
|
4681
4607
|
function _arrayWithHoles(arr) {
|
|
@@ -4683,14 +4609,11 @@
|
|
|
4683
4609
|
}
|
|
4684
4610
|
|
|
4685
4611
|
function _iterableToArray(iter) {
|
|
4686
|
-
if (Symbol.iterator in Object(iter)
|
|
4612
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
4687
4613
|
}
|
|
4688
4614
|
|
|
4689
4615
|
function _iterableToArrayLimit(arr, i) {
|
|
4690
|
-
if (!(Symbol.iterator in Object(arr)
|
|
4691
|
-
return;
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4616
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
4694
4617
|
var _arr = [];
|
|
4695
4618
|
var _n = true;
|
|
4696
4619
|
var _d = false;
|
|
@@ -4716,30 +4639,84 @@
|
|
|
4716
4639
|
return _arr;
|
|
4717
4640
|
}
|
|
4718
4641
|
|
|
4642
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
4643
|
+
if (!o) return;
|
|
4644
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
4645
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4646
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4647
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
4648
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4649
|
+
}
|
|
4650
|
+
|
|
4651
|
+
function _arrayLikeToArray(arr, len) {
|
|
4652
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4653
|
+
|
|
4654
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
4655
|
+
arr2[i] = arr[i];
|
|
4656
|
+
}
|
|
4657
|
+
|
|
4658
|
+
return arr2;
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4719
4661
|
function _nonIterableSpread() {
|
|
4720
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
4662
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4721
4663
|
}
|
|
4722
4664
|
|
|
4723
4665
|
function _nonIterableRest() {
|
|
4724
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
4666
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4725
4667
|
}
|
|
4668
|
+
/**
|
|
4669
|
+
* @callback TypesonFulfilled
|
|
4670
|
+
* @returns {Promise<any>|any}
|
|
4671
|
+
*/
|
|
4672
|
+
|
|
4673
|
+
/**
|
|
4674
|
+
* @callback TypesonRejected
|
|
4675
|
+
* @returns {Promise<any>|any}
|
|
4676
|
+
*/
|
|
4677
|
+
|
|
4678
|
+
/**
|
|
4679
|
+
* @callback TypesonResolve
|
|
4680
|
+
* @param {any} value
|
|
4681
|
+
* @returns {Promise<any>}
|
|
4682
|
+
*/
|
|
4683
|
+
|
|
4684
|
+
/**
|
|
4685
|
+
* @callback TypesonReject
|
|
4686
|
+
* @param {Error|any} error
|
|
4687
|
+
* @returns {Promise<any>}
|
|
4688
|
+
*/
|
|
4689
|
+
|
|
4690
|
+
/**
|
|
4691
|
+
* @callback TypesonResolveReject
|
|
4692
|
+
* @param {TypesonResolve} typesonResolve
|
|
4693
|
+
* @param {TypesonReject} typesonReject
|
|
4694
|
+
* @returns {Promise<any>}
|
|
4695
|
+
*/
|
|
4696
|
+
|
|
4697
|
+
/* eslint-disable block-spacing, space-before-function-paren,
|
|
4698
|
+
space-before-blocks, space-infix-ops, semi, promise/avoid-new,
|
|
4699
|
+
jsdoc/require-jsdoc */
|
|
4700
|
+
|
|
4726
4701
|
/**
|
|
4727
4702
|
* We keep this function minimized so if using two instances of this
|
|
4728
4703
|
* library, where one is minimized and one is not, it will still work
|
|
4729
4704
|
* with `hasConstructorOf`.
|
|
4730
4705
|
* With ES6 classes, we may be able to simply use `class TypesonPromise
|
|
4731
4706
|
* extends Promise` and add a string tag for detection.
|
|
4732
|
-
* @param {
|
|
4707
|
+
* @param {TypesonResolveReject} f
|
|
4733
4708
|
*/
|
|
4734
|
-
// eslint-disable-next-line max-len
|
|
4735
|
-
// eslint-disable-next-line block-spacing, space-before-function-paren, space-before-blocks, space-infix-ops, semi, promise/avoid-new
|
|
4736
4709
|
|
|
4737
4710
|
|
|
4738
4711
|
var TypesonPromise = function TypesonPromise(f) {
|
|
4739
4712
|
_classCallCheck(this, TypesonPromise);
|
|
4740
4713
|
|
|
4741
4714
|
this.p = new Promise(f);
|
|
4742
|
-
};
|
|
4715
|
+
};
|
|
4716
|
+
/* eslint-enable block-spacing, space-before-function-paren,
|
|
4717
|
+
space-before-blocks, space-infix-ops, semi, promise/avoid-new,
|
|
4718
|
+
jsdoc/require-jsdoc */
|
|
4719
|
+
// eslint-disable-next-line max-len
|
|
4743
4720
|
// class TypesonPromise extends Promise {get[Symbol.toStringTag](){return 'TypesonPromise'};} // eslint-disable-line keyword-spacing, space-before-function-paren, space-before-blocks, block-spacing, semi
|
|
4744
4721
|
|
|
4745
4722
|
|
|
@@ -4753,8 +4730,8 @@
|
|
|
4753
4730
|
}
|
|
4754
4731
|
/**
|
|
4755
4732
|
*
|
|
4756
|
-
* @param {
|
|
4757
|
-
* @param {
|
|
4733
|
+
* @param {TypesonFulfilled} [onFulfilled]
|
|
4734
|
+
* @param {TypesonRejected} [onRejected]
|
|
4758
4735
|
* @returns {TypesonPromise}
|
|
4759
4736
|
*/
|
|
4760
4737
|
|
|
@@ -4774,7 +4751,7 @@
|
|
|
4774
4751
|
};
|
|
4775
4752
|
/**
|
|
4776
4753
|
*
|
|
4777
|
-
* @param {
|
|
4754
|
+
* @param {TypesonRejected} onRejected
|
|
4778
4755
|
* @returns {TypesonPromise}
|
|
4779
4756
|
*/
|
|
4780
4757
|
|
|
@@ -4784,7 +4761,7 @@
|
|
|
4784
4761
|
};
|
|
4785
4762
|
/**
|
|
4786
4763
|
*
|
|
4787
|
-
* @param {
|
|
4764
|
+
* @param {any} v
|
|
4788
4765
|
* @returns {TypesonPromise}
|
|
4789
4766
|
*/
|
|
4790
4767
|
|
|
@@ -4796,7 +4773,7 @@
|
|
|
4796
4773
|
};
|
|
4797
4774
|
/**
|
|
4798
4775
|
*
|
|
4799
|
-
* @param {
|
|
4776
|
+
* @param {any} v
|
|
4800
4777
|
* @returns {TypesonPromise}
|
|
4801
4778
|
*/
|
|
4802
4779
|
|
|
@@ -4807,10 +4784,10 @@
|
|
|
4807
4784
|
});
|
|
4808
4785
|
};
|
|
4809
4786
|
|
|
4810
|
-
['all', 'race'].forEach(function (meth) {
|
|
4787
|
+
['all', 'race', 'allSettled'].forEach(function (meth) {
|
|
4811
4788
|
/**
|
|
4812
4789
|
*
|
|
4813
|
-
* @param {Promise[]} promArr
|
|
4790
|
+
* @param {Promise<any>[]} promArr
|
|
4814
4791
|
* @returns {TypesonPromise}
|
|
4815
4792
|
*/
|
|
4816
4793
|
TypesonPromise[meth] = function (promArr) {
|
|
@@ -4824,12 +4801,12 @@
|
|
|
4824
4801
|
});
|
|
4825
4802
|
var _ref = {},
|
|
4826
4803
|
toStr = _ref.toString,
|
|
4827
|
-
hasOwn = {}.hasOwnProperty,
|
|
4804
|
+
hasOwn$1 = {}.hasOwnProperty,
|
|
4828
4805
|
getProto = Object.getPrototypeOf,
|
|
4829
|
-
fnToString = hasOwn.toString;
|
|
4806
|
+
fnToString = hasOwn$1.toString;
|
|
4830
4807
|
/**
|
|
4831
4808
|
* Second argument not in use internally, but provided for utility.
|
|
4832
|
-
* @param {
|
|
4809
|
+
* @param {any} v
|
|
4833
4810
|
* @param {boolean} catchCheck
|
|
4834
4811
|
* @returns {boolean}
|
|
4835
4812
|
*/
|
|
@@ -4839,7 +4816,7 @@
|
|
|
4839
4816
|
}
|
|
4840
4817
|
/**
|
|
4841
4818
|
*
|
|
4842
|
-
* @param {
|
|
4819
|
+
* @param {any} val
|
|
4843
4820
|
* @returns {string}
|
|
4844
4821
|
*/
|
|
4845
4822
|
|
|
@@ -4850,14 +4827,14 @@
|
|
|
4850
4827
|
/**
|
|
4851
4828
|
* This function is dependent on both constructors
|
|
4852
4829
|
* being identical so any minimization is expected of both.
|
|
4853
|
-
* @param {
|
|
4854
|
-
* @param {
|
|
4830
|
+
* @param {any} a
|
|
4831
|
+
* @param {GenericFunction} b
|
|
4855
4832
|
* @returns {boolean}
|
|
4856
4833
|
*/
|
|
4857
4834
|
|
|
4858
4835
|
|
|
4859
4836
|
function hasConstructorOf(a, b) {
|
|
4860
|
-
if (!a || _typeof
|
|
4837
|
+
if (!a || _typeof(a) !== 'object') {
|
|
4861
4838
|
return false;
|
|
4862
4839
|
}
|
|
4863
4840
|
|
|
@@ -4867,7 +4844,7 @@
|
|
|
4867
4844
|
return b === null;
|
|
4868
4845
|
}
|
|
4869
4846
|
|
|
4870
|
-
var Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;
|
|
4847
|
+
var Ctor = hasOwn$1.call(proto, 'constructor') && proto.constructor;
|
|
4871
4848
|
|
|
4872
4849
|
if (typeof Ctor !== 'function') {
|
|
4873
4850
|
return b === null;
|
|
@@ -4889,7 +4866,7 @@
|
|
|
4889
4866
|
}
|
|
4890
4867
|
/**
|
|
4891
4868
|
*
|
|
4892
|
-
* @param {
|
|
4869
|
+
* @param {any} val
|
|
4893
4870
|
* @returns {boolean}
|
|
4894
4871
|
*/
|
|
4895
4872
|
|
|
@@ -4911,7 +4888,7 @@
|
|
|
4911
4888
|
}
|
|
4912
4889
|
/**
|
|
4913
4890
|
*
|
|
4914
|
-
* @param {
|
|
4891
|
+
* @param {any} val
|
|
4915
4892
|
* @returns {boolean}
|
|
4916
4893
|
*/
|
|
4917
4894
|
|
|
@@ -4932,13 +4909,13 @@
|
|
|
4932
4909
|
}
|
|
4933
4910
|
/**
|
|
4934
4911
|
*
|
|
4935
|
-
* @param {
|
|
4912
|
+
* @param {any} v
|
|
4936
4913
|
* @returns {boolean}
|
|
4937
4914
|
*/
|
|
4938
4915
|
|
|
4939
4916
|
|
|
4940
4917
|
function isObject(v) {
|
|
4941
|
-
return v && _typeof
|
|
4918
|
+
return v && _typeof(v) === 'object';
|
|
4942
4919
|
}
|
|
4943
4920
|
/**
|
|
4944
4921
|
*
|
|
@@ -4963,7 +4940,7 @@
|
|
|
4963
4940
|
/**
|
|
4964
4941
|
* @param {PlainObject|GenericArray} obj
|
|
4965
4942
|
* @param {string} keyPath
|
|
4966
|
-
* @returns {
|
|
4943
|
+
* @returns {any}
|
|
4967
4944
|
*/
|
|
4968
4945
|
|
|
4969
4946
|
|
|
@@ -4985,8 +4962,8 @@
|
|
|
4985
4962
|
*
|
|
4986
4963
|
* @param {PlainObject} obj
|
|
4987
4964
|
* @param {string} keyPath
|
|
4988
|
-
* @param {
|
|
4989
|
-
* @returns {
|
|
4965
|
+
* @param {any} value
|
|
4966
|
+
* @returns {any}
|
|
4990
4967
|
*/
|
|
4991
4968
|
|
|
4992
4969
|
|
|
@@ -5014,12 +4991,24 @@
|
|
|
5014
4991
|
|
|
5015
4992
|
|
|
5016
4993
|
function getJSONType(value) {
|
|
5017
|
-
return value === null ? 'null' : Array.isArray(value) ? 'array' : _typeof
|
|
4994
|
+
return value === null ? 'null' : Array.isArray(value) ? 'array' : _typeof(value);
|
|
4995
|
+
}
|
|
4996
|
+
|
|
4997
|
+
function _await(value, then, direct) {
|
|
4998
|
+
if (direct) {
|
|
4999
|
+
return then ? then(value) : value;
|
|
5000
|
+
}
|
|
5001
|
+
|
|
5002
|
+
if (!value || !value.then) {
|
|
5003
|
+
value = Promise.resolve(value);
|
|
5004
|
+
}
|
|
5005
|
+
|
|
5006
|
+
return then ? value.then(then) : value;
|
|
5018
5007
|
}
|
|
5019
5008
|
|
|
5020
5009
|
var keys = Object.keys,
|
|
5021
5010
|
isArray = Array.isArray,
|
|
5022
|
-
hasOwn
|
|
5011
|
+
hasOwn = {}.hasOwnProperty,
|
|
5023
5012
|
internalStateObjPropsToIgnore = ['type', 'replaced', 'iterateIn', 'iterateUnsetNumeric'];
|
|
5024
5013
|
/**
|
|
5025
5014
|
* Handle plain object revivers first so reference setting can use
|
|
@@ -5030,6 +5019,66 @@
|
|
|
5030
5019
|
* @returns {1|-1|boolean}
|
|
5031
5020
|
*/
|
|
5032
5021
|
|
|
5022
|
+
function _async(f) {
|
|
5023
|
+
return function () {
|
|
5024
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
5025
|
+
args[i] = arguments[i];
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
try {
|
|
5029
|
+
return Promise.resolve(f.apply(this, args));
|
|
5030
|
+
} catch (e) {
|
|
5031
|
+
return Promise.reject(e);
|
|
5032
|
+
}
|
|
5033
|
+
};
|
|
5034
|
+
}
|
|
5035
|
+
/**
|
|
5036
|
+
* @callback Tester
|
|
5037
|
+
* @param {any} value
|
|
5038
|
+
* @param {StateObject} stateobj
|
|
5039
|
+
* @returns {boolean}
|
|
5040
|
+
*/
|
|
5041
|
+
|
|
5042
|
+
/**
|
|
5043
|
+
* @callback Replacer
|
|
5044
|
+
* @param {any} value
|
|
5045
|
+
* @param {StateObject} stateObj
|
|
5046
|
+
* @returns {any} Should be JSON-stringifiable
|
|
5047
|
+
*/
|
|
5048
|
+
|
|
5049
|
+
/**
|
|
5050
|
+
* @callback Reviver
|
|
5051
|
+
* @param {JSON} value
|
|
5052
|
+
* @param {StateObject} stateObj
|
|
5053
|
+
* @returns {any}
|
|
5054
|
+
*/
|
|
5055
|
+
|
|
5056
|
+
/**
|
|
5057
|
+
* @typedef {PlainObject} TypesonOptions
|
|
5058
|
+
* @property {boolean} stringification Auto-set by `stringify`
|
|
5059
|
+
*/
|
|
5060
|
+
|
|
5061
|
+
/**
|
|
5062
|
+
* An instance of this class can be used to call `stringify()` and `parse()`.
|
|
5063
|
+
* Typeson resolves cyclic references by default. Can also be extended to
|
|
5064
|
+
* support custom types using the register() method.
|
|
5065
|
+
*
|
|
5066
|
+
* @class
|
|
5067
|
+
* @param {{cyclic: boolean}} [options] - if cyclic (default true),
|
|
5068
|
+
* cyclic references will be handled gracefully.
|
|
5069
|
+
*/
|
|
5070
|
+
|
|
5071
|
+
|
|
5072
|
+
function _invoke(body, then) {
|
|
5073
|
+
var result = body();
|
|
5074
|
+
|
|
5075
|
+
if (result && result.then) {
|
|
5076
|
+
return result.then(then);
|
|
5077
|
+
}
|
|
5078
|
+
|
|
5079
|
+
return then(result);
|
|
5080
|
+
}
|
|
5081
|
+
|
|
5033
5082
|
function nestedPathsFirst(a, b) {
|
|
5034
5083
|
if (a.keypath === '') {
|
|
5035
5084
|
return -1;
|
|
@@ -5048,18 +5097,11 @@
|
|
|
5048
5097
|
|
|
5049
5098
|
return as > bs ? -1 : as < bs ? 1 : a.keypath < b.keypath ? -1 : a.keypath > b.keypath;
|
|
5050
5099
|
}
|
|
5051
|
-
/**
|
|
5052
|
-
* An instance of this class can be used to call `stringify()` and `parse()`.
|
|
5053
|
-
* Typeson resolves cyclic references by default. Can also be extended to
|
|
5054
|
-
* support custom types using the register() method.
|
|
5055
|
-
*
|
|
5056
|
-
* @class
|
|
5057
|
-
* @param {{cyclic: boolean}} [options] - if cyclic (default true),
|
|
5058
|
-
* cyclic references will be handled gracefully.
|
|
5059
|
-
*/
|
|
5060
|
-
|
|
5061
5100
|
|
|
5062
5101
|
var Typeson = /*#__PURE__*/function () {
|
|
5102
|
+
/**
|
|
5103
|
+
* @param {TypesonOptions} options
|
|
5104
|
+
*/
|
|
5063
5105
|
function Typeson(options) {
|
|
5064
5106
|
_classCallCheck(this, Typeson);
|
|
5065
5107
|
|
|
@@ -5091,18 +5133,18 @@
|
|
|
5091
5133
|
* Serialize given object to Typeson.
|
|
5092
5134
|
* Initial arguments work identical to those of `JSON.stringify`.
|
|
5093
5135
|
* The `replacer` argument has nothing to do with our replacers.
|
|
5094
|
-
* @param {
|
|
5136
|
+
* @param {any} obj
|
|
5095
5137
|
* @param {JSONReplacer|string[]} replacer
|
|
5096
5138
|
* @param {number|string} space
|
|
5097
|
-
* @param {
|
|
5098
|
-
* @returns {string|Promise} Promise resolves to a string
|
|
5139
|
+
* @param {TypesonOptions} opts
|
|
5140
|
+
* @returns {string|Promise<string>} Promise resolves to a string
|
|
5099
5141
|
*/
|
|
5100
5142
|
|
|
5101
5143
|
|
|
5102
5144
|
_createClass(Typeson, [{
|
|
5103
5145
|
key: "stringify",
|
|
5104
5146
|
value: function stringify(obj, replacer, space, opts) {
|
|
5105
|
-
opts = _objectSpread2({}, this.options, {},
|
|
5147
|
+
opts = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), opts), {}, {
|
|
5106
5148
|
stringification: true
|
|
5107
5149
|
});
|
|
5108
5150
|
var encapsulated = this.encapsulate(obj, null, opts);
|
|
@@ -5117,54 +5159,61 @@
|
|
|
5117
5159
|
}
|
|
5118
5160
|
/**
|
|
5119
5161
|
* Also sync but throws on non-sync result.
|
|
5120
|
-
* @param {
|
|
5162
|
+
* @param {any} obj
|
|
5121
5163
|
* @param {JSONReplacer|string[]} replacer
|
|
5122
5164
|
* @param {number|string} space
|
|
5123
|
-
* @param {
|
|
5165
|
+
* @param {TypesonOptions} opts
|
|
5124
5166
|
* @returns {string}
|
|
5125
5167
|
*/
|
|
5126
5168
|
|
|
5127
5169
|
}, {
|
|
5128
5170
|
key: "stringifySync",
|
|
5129
5171
|
value: function stringifySync(obj, replacer, space, opts) {
|
|
5130
|
-
return this.stringify(obj, replacer, space, _objectSpread2({
|
|
5172
|
+
return this.stringify(obj, replacer, space, _objectSpread2(_objectSpread2({
|
|
5131
5173
|
throwOnBadSyncType: true
|
|
5132
|
-
}, opts, {
|
|
5174
|
+
}, opts), {}, {
|
|
5133
5175
|
sync: true
|
|
5134
5176
|
}));
|
|
5135
5177
|
}
|
|
5136
5178
|
/**
|
|
5137
5179
|
*
|
|
5138
|
-
* @param {
|
|
5180
|
+
* @param {any} obj
|
|
5139
5181
|
* @param {JSONReplacer|string[]} replacer
|
|
5140
5182
|
* @param {number|string} space
|
|
5141
|
-
* @param {
|
|
5183
|
+
* @param {TypesonOptions} opts
|
|
5142
5184
|
* @returns {Promise<string>}
|
|
5143
5185
|
*/
|
|
5144
5186
|
|
|
5145
5187
|
}, {
|
|
5146
5188
|
key: "stringifyAsync",
|
|
5147
5189
|
value: function stringifyAsync(obj, replacer, space, opts) {
|
|
5148
|
-
return this.stringify(obj, replacer, space, _objectSpread2({
|
|
5190
|
+
return this.stringify(obj, replacer, space, _objectSpread2(_objectSpread2({
|
|
5149
5191
|
throwOnBadSyncType: true
|
|
5150
|
-
}, opts, {
|
|
5192
|
+
}, opts), {}, {
|
|
5151
5193
|
sync: false
|
|
5152
5194
|
}));
|
|
5153
5195
|
}
|
|
5196
|
+
/**
|
|
5197
|
+
* @callback JSONReviver
|
|
5198
|
+
* @param {string} key
|
|
5199
|
+
* @param {JSON} value
|
|
5200
|
+
* @returns {JSON}
|
|
5201
|
+
*/
|
|
5202
|
+
|
|
5154
5203
|
/**
|
|
5155
5204
|
* Parse Typeson back into an obejct.
|
|
5156
5205
|
* Initial arguments works identical to those of `JSON.parse()`.
|
|
5157
5206
|
* @param {string} text
|
|
5158
|
-
* @param {
|
|
5207
|
+
* @param {JSONReviver} reviver This JSON reviver has nothing to do with
|
|
5159
5208
|
* our revivers.
|
|
5160
|
-
* @param {
|
|
5209
|
+
* @param {TypesonOptions} opts
|
|
5161
5210
|
* @returns {external:JSON}
|
|
5162
5211
|
*/
|
|
5163
5212
|
|
|
5164
5213
|
}, {
|
|
5165
5214
|
key: "parse",
|
|
5166
5215
|
value: function parse(text, reviver, opts) {
|
|
5167
|
-
opts = _objectSpread2({}, this.options, {},
|
|
5216
|
+
opts = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), opts), {}, {
|
|
5168
5217
|
parse: true
|
|
5169
5218
|
});
|
|
5170
5219
|
return this.revive(JSON.parse(text, reviver), opts);
|
|
@@ -5172,43 +5221,47 @@
|
|
|
5172
5221
|
/**
|
|
5173
5222
|
* Also sync but throws on non-sync result.
|
|
5174
5223
|
* @param {string} text
|
|
5175
|
-
* @param {
|
|
5224
|
+
* @param {JSONReviver} reviver This JSON reviver has nothing to do with
|
|
5176
5225
|
* our revivers.
|
|
5177
|
-
* @param {
|
|
5226
|
+
* @param {TypesonOptions} opts
|
|
5178
5227
|
* @returns {external:JSON}
|
|
5179
5228
|
*/
|
|
5180
5229
|
|
|
5181
5230
|
}, {
|
|
5182
5231
|
key: "parseSync",
|
|
5183
5232
|
value: function parseSync(text, reviver, opts) {
|
|
5184
|
-
return this.parse(text, reviver, _objectSpread2({
|
|
5233
|
+
return this.parse(text, reviver, _objectSpread2(_objectSpread2({
|
|
5185
5234
|
throwOnBadSyncType: true
|
|
5186
|
-
}, opts, {
|
|
5235
|
+
}, opts), {}, {
|
|
5187
5236
|
sync: true
|
|
5188
5237
|
}));
|
|
5189
5238
|
}
|
|
5190
5239
|
/**
|
|
5191
5240
|
* @param {string} text
|
|
5192
|
-
* @param {
|
|
5241
|
+
* @param {JSONReviver} reviver This JSON reviver has nothing to do with
|
|
5193
5242
|
* our revivers.
|
|
5194
|
-
* @param {
|
|
5195
|
-
* @returns {Promise} Resolves to `external:JSON`
|
|
5243
|
+
* @param {TypesonOptions} opts
|
|
5244
|
+
* @returns {Promise<external:JSON>} Resolves to `external:JSON`
|
|
5196
5245
|
*/
|
|
5197
5246
|
|
|
5198
5247
|
}, {
|
|
5199
5248
|
key: "parseAsync",
|
|
5200
5249
|
value: function parseAsync(text, reviver, opts) {
|
|
5201
|
-
return this.parse(text, reviver, _objectSpread2({
|
|
5250
|
+
return this.parse(text, reviver, _objectSpread2(_objectSpread2({
|
|
5202
5251
|
throwOnBadSyncType: true
|
|
5203
|
-
}, opts, {
|
|
5252
|
+
}, opts), {}, {
|
|
5204
5253
|
sync: false
|
|
5205
5254
|
}));
|
|
5206
5255
|
}
|
|
5256
|
+
/**
|
|
5257
|
+
* @typedef {} StateObject
|
|
5258
|
+
*/
|
|
5259
|
+
|
|
5207
5260
|
/**
|
|
5208
5261
|
*
|
|
5209
|
-
* @param {
|
|
5210
|
-
* @param {
|
|
5211
|
-
* @param {
|
|
5262
|
+
* @param {any} obj
|
|
5263
|
+
* @param {StateObject} stateObj
|
|
5264
|
+
* @param {TypesonOptions} [opts={}]
|
|
5212
5265
|
* @returns {string[]|false}
|
|
5213
5266
|
*/
|
|
5214
5267
|
|
|
@@ -5221,10 +5274,10 @@
|
|
|
5221
5274
|
}
|
|
5222
5275
|
/**
|
|
5223
5276
|
*
|
|
5224
|
-
* @param {
|
|
5277
|
+
* @param {any} obj
|
|
5225
5278
|
* @param {PlainObject} stateObj
|
|
5226
5279
|
* @param {PlainObject} [opts={}]
|
|
5227
|
-
* @returns {Promise
|
|
5280
|
+
* @returns {Promise<any>|GenericArray|PlainObject|string|false}
|
|
5228
5281
|
*/
|
|
5229
5282
|
|
|
5230
5283
|
}, {
|
|
@@ -5239,18 +5292,101 @@
|
|
|
5239
5292
|
* registered types with plain objects representing the types data.
|
|
5240
5293
|
*
|
|
5241
5294
|
* This method is used internally by `Typeson.stringify()`.
|
|
5242
|
-
* @param {
|
|
5295
|
+
* @param {any} obj - Object to encapsulate.
|
|
5243
5296
|
* @param {PlainObject} stateObj
|
|
5244
5297
|
* @param {PlainObject} opts
|
|
5245
|
-
* @returns {Promise
|
|
5298
|
+
* @returns {Promise<any>|GenericArray|PlainObject|string|false}
|
|
5246
5299
|
*/
|
|
5247
5300
|
|
|
5248
5301
|
}, {
|
|
5249
5302
|
key: "encapsulate",
|
|
5250
5303
|
value: function encapsulate(obj, stateObj, opts) {
|
|
5251
|
-
|
|
5304
|
+
/**
|
|
5305
|
+
*
|
|
5306
|
+
* @param {any} ret
|
|
5307
|
+
* @param {GenericArray} promisesData
|
|
5308
|
+
* @returns {Promise<any>}
|
|
5309
|
+
*/
|
|
5310
|
+
var checkPromises = _async(function (ret, promisesData) {
|
|
5311
|
+
return _await(Promise.all(promisesData.map(function (pd) {
|
|
5312
|
+
return pd[1].p;
|
|
5313
|
+
})), function (promResults) {
|
|
5314
|
+
return _await(Promise.all(promResults.map(_async(function (promResult) {
|
|
5315
|
+
var _exit = false;
|
|
5316
|
+
var newPromisesData = [];
|
|
5317
|
+
|
|
5318
|
+
var _promisesData$splice = promisesData.splice(0, 1),
|
|
5319
|
+
_promisesData$splice2 = _slicedToArray(_promisesData$splice, 1),
|
|
5320
|
+
prData = _promisesData$splice2[0];
|
|
5321
|
+
|
|
5322
|
+
var _prData = _slicedToArray(prData, 7),
|
|
5323
|
+
keyPath = _prData[0],
|
|
5324
|
+
cyclic = _prData[2],
|
|
5325
|
+
stateObj = _prData[3],
|
|
5326
|
+
parentObj = _prData[4],
|
|
5327
|
+
key = _prData[5],
|
|
5328
|
+
detectedType = _prData[6];
|
|
5329
|
+
|
|
5330
|
+
var encaps = _encapsulate(keyPath, promResult, cyclic, stateObj, newPromisesData, true, detectedType);
|
|
5331
|
+
|
|
5332
|
+
var isTypesonPromise = hasConstructorOf(encaps, TypesonPromise); // Handle case where an embedded custom type itself
|
|
5333
|
+
// returns a `Typeson.Promise`
|
|
5334
|
+
|
|
5335
|
+
return _invoke(function () {
|
|
5336
|
+
if (keyPath && isTypesonPromise) {
|
|
5337
|
+
return _await(encaps.p, function (encaps2) {
|
|
5338
|
+
parentObj[key] = encaps2;
|
|
5339
|
+
_exit = true;
|
|
5340
|
+
return checkPromises(ret, newPromisesData);
|
|
5341
|
+
});
|
|
5342
|
+
}
|
|
5343
|
+
}, function (_result) {
|
|
5344
|
+
if (_exit) return _result;
|
|
5345
|
+
|
|
5346
|
+
if (keyPath) {
|
|
5347
|
+
parentObj[key] = encaps;
|
|
5348
|
+
} else if (isTypesonPromise) {
|
|
5349
|
+
ret = encaps.p;
|
|
5350
|
+
} else {
|
|
5351
|
+
// If this is itself a `Typeson.Promise` (because the
|
|
5352
|
+
// original value supplied was a `Promise` or
|
|
5353
|
+
// because the supplied custom type value resolved
|
|
5354
|
+
// to one), returning it below will be fine since
|
|
5355
|
+
// a `Promise` is expected anyways given current
|
|
5356
|
+
// config (and if not a `Promise`, it will be ready
|
|
5357
|
+
// as the resolve value)
|
|
5358
|
+
ret = encaps;
|
|
5359
|
+
}
|
|
5360
|
+
|
|
5361
|
+
return checkPromises(ret, newPromisesData);
|
|
5362
|
+
});
|
|
5363
|
+
}))), function () {
|
|
5364
|
+
return ret;
|
|
5365
|
+
});
|
|
5366
|
+
});
|
|
5367
|
+
});
|
|
5368
|
+
/**
|
|
5369
|
+
* @typedef {PlainObject} OwnKeysObject
|
|
5370
|
+
* @property {boolean} ownKeys
|
|
5371
|
+
*/
|
|
5372
|
+
|
|
5373
|
+
/**
|
|
5374
|
+
* @callback BuiltinStateObjectPropertiesCallback
|
|
5375
|
+
* @returns {void}
|
|
5376
|
+
*/
|
|
5377
|
+
|
|
5378
|
+
/**
|
|
5379
|
+
*
|
|
5380
|
+
* @param {StateObject} stateObj
|
|
5381
|
+
* @param {OwnKeysObject} ownKeysObj
|
|
5382
|
+
* @param {BuiltinStateObjectPropertiesCallback} cb
|
|
5383
|
+
* @returns {undefined}
|
|
5384
|
+
*/
|
|
5385
|
+
|
|
5386
|
+
|
|
5387
|
+
opts = _objectSpread2(_objectSpread2({
|
|
5252
5388
|
sync: true
|
|
5253
|
-
}, this.options,
|
|
5389
|
+
}, this.options), opts);
|
|
5254
5390
|
var _opts = opts,
|
|
5255
5391
|
sync = _opts.sync;
|
|
5256
5392
|
var that = this,
|
|
@@ -5269,7 +5405,7 @@
|
|
|
5269
5405
|
var ret = _encapsulate('', obj, cyclic, stateObj || {}, promisesDataRoot);
|
|
5270
5406
|
/**
|
|
5271
5407
|
*
|
|
5272
|
-
* @param {
|
|
5408
|
+
* @param {any} ret
|
|
5273
5409
|
* @returns {GenericArray|PlainObject|string|false}
|
|
5274
5410
|
*/
|
|
5275
5411
|
|
|
@@ -5296,7 +5432,7 @@
|
|
|
5296
5432
|
|
|
5297
5433
|
if (!ret || !isPlainObject(ret) || // Also need to handle if this is an object with its
|
|
5298
5434
|
// own `$types` property (to avoid ambiguity)
|
|
5299
|
-
hasOwn
|
|
5435
|
+
hasOwn.call(ret, '$types')) {
|
|
5300
5436
|
ret = {
|
|
5301
5437
|
$: ret,
|
|
5302
5438
|
$types: {
|
|
@@ -5307,7 +5443,7 @@
|
|
|
5307
5443
|
ret.$types = types;
|
|
5308
5444
|
} // No special types
|
|
5309
5445
|
|
|
5310
|
-
} else if (isObject(ret) && hasOwn
|
|
5446
|
+
} else if (isObject(ret) && hasOwn.call(ret, '$types')) {
|
|
5311
5447
|
ret = {
|
|
5312
5448
|
$: ret,
|
|
5313
5449
|
$types: true
|
|
@@ -5320,112 +5456,6 @@
|
|
|
5320
5456
|
|
|
5321
5457
|
return ret;
|
|
5322
5458
|
}
|
|
5323
|
-
/**
|
|
5324
|
-
*
|
|
5325
|
-
* @param {Any} ret
|
|
5326
|
-
* @param {GenericArray} promisesData
|
|
5327
|
-
* @returns {Promise<Any>}
|
|
5328
|
-
*/
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
function checkPromises(_x, _x2) {
|
|
5332
|
-
return _checkPromises.apply(this, arguments);
|
|
5333
|
-
}
|
|
5334
|
-
/**
|
|
5335
|
-
*
|
|
5336
|
-
* @param {object} stateObj
|
|
5337
|
-
* @param {object} ownKeysObj
|
|
5338
|
-
* @param {function} cb
|
|
5339
|
-
* @returns {undefined}
|
|
5340
|
-
*/
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
function _checkPromises() {
|
|
5344
|
-
_checkPromises = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ret, promisesData) {
|
|
5345
|
-
var promResults;
|
|
5346
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
5347
|
-
while (1) {
|
|
5348
|
-
switch (_context2.prev = _context2.next) {
|
|
5349
|
-
case 0:
|
|
5350
|
-
_context2.next = 2;
|
|
5351
|
-
return Promise.all(promisesData.map(function (pd) {
|
|
5352
|
-
return pd[1].p;
|
|
5353
|
-
}));
|
|
5354
|
-
|
|
5355
|
-
case 2:
|
|
5356
|
-
promResults = _context2.sent;
|
|
5357
|
-
_context2.next = 5;
|
|
5358
|
-
return Promise.all(promResults.map( /*#__PURE__*/function () {
|
|
5359
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(promResult) {
|
|
5360
|
-
var newPromisesData, _promisesData$splice, _promisesData$splice2, prData, _prData, keyPath, cyclic, stateObj, parentObj, key, detectedType, encaps, isTypesonPromise, encaps2;
|
|
5361
|
-
|
|
5362
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
5363
|
-
while (1) {
|
|
5364
|
-
switch (_context.prev = _context.next) {
|
|
5365
|
-
case 0:
|
|
5366
|
-
newPromisesData = [];
|
|
5367
|
-
_promisesData$splice = promisesData.splice(0, 1), _promisesData$splice2 = _slicedToArray(_promisesData$splice, 1), prData = _promisesData$splice2[0];
|
|
5368
|
-
_prData = _slicedToArray(prData, 7), keyPath = _prData[0], cyclic = _prData[2], stateObj = _prData[3], parentObj = _prData[4], key = _prData[5], detectedType = _prData[6];
|
|
5369
|
-
encaps = _encapsulate(keyPath, promResult, cyclic, stateObj, newPromisesData, true, detectedType);
|
|
5370
|
-
isTypesonPromise = hasConstructorOf(encaps, TypesonPromise); // Handle case where an embedded custom type itself
|
|
5371
|
-
// returns a `Typeson.Promise`
|
|
5372
|
-
|
|
5373
|
-
if (!(keyPath && isTypesonPromise)) {
|
|
5374
|
-
_context.next = 11;
|
|
5375
|
-
break;
|
|
5376
|
-
}
|
|
5377
|
-
|
|
5378
|
-
_context.next = 8;
|
|
5379
|
-
return encaps.p;
|
|
5380
|
-
|
|
5381
|
-
case 8:
|
|
5382
|
-
encaps2 = _context.sent;
|
|
5383
|
-
parentObj[key] = encaps2;
|
|
5384
|
-
return _context.abrupt("return", checkPromises(ret, newPromisesData));
|
|
5385
|
-
|
|
5386
|
-
case 11:
|
|
5387
|
-
if (keyPath) {
|
|
5388
|
-
parentObj[key] = encaps;
|
|
5389
|
-
} else if (isTypesonPromise) {
|
|
5390
|
-
ret = encaps.p;
|
|
5391
|
-
} else {
|
|
5392
|
-
// If this is itself a `Typeson.Promise` (because the
|
|
5393
|
-
// original value supplied was a `Promise` or
|
|
5394
|
-
// because the supplied custom type value resolved
|
|
5395
|
-
// to one), returning it below will be fine since
|
|
5396
|
-
// a `Promise` is expected anyways given current
|
|
5397
|
-
// config (and if not a `Promise`, it will be ready
|
|
5398
|
-
// as the resolve value)
|
|
5399
|
-
ret = encaps;
|
|
5400
|
-
}
|
|
5401
|
-
|
|
5402
|
-
return _context.abrupt("return", checkPromises(ret, newPromisesData));
|
|
5403
|
-
|
|
5404
|
-
case 13:
|
|
5405
|
-
case "end":
|
|
5406
|
-
return _context.stop();
|
|
5407
|
-
}
|
|
5408
|
-
}
|
|
5409
|
-
}, _callee);
|
|
5410
|
-
}));
|
|
5411
|
-
|
|
5412
|
-
return function (_x3) {
|
|
5413
|
-
return _ref.apply(this, arguments);
|
|
5414
|
-
};
|
|
5415
|
-
}()));
|
|
5416
|
-
|
|
5417
|
-
case 5:
|
|
5418
|
-
return _context2.abrupt("return", ret);
|
|
5419
|
-
|
|
5420
|
-
case 6:
|
|
5421
|
-
case "end":
|
|
5422
|
-
return _context2.stop();
|
|
5423
|
-
}
|
|
5424
|
-
}
|
|
5425
|
-
}, _callee2);
|
|
5426
|
-
}));
|
|
5427
|
-
return _checkPromises.apply(this, arguments);
|
|
5428
|
-
}
|
|
5429
5459
|
|
|
5430
5460
|
function _adaptBuiltinStateObjectProperties(stateObj, ownKeysObj, cb) {
|
|
5431
5461
|
Object.assign(stateObj, ownKeysObj);
|
|
@@ -5433,7 +5463,7 @@
|
|
|
5433
5463
|
var tmp = stateObj[prop];
|
|
5434
5464
|
delete stateObj[prop];
|
|
5435
5465
|
return tmp;
|
|
5436
|
-
}); // eslint-disable-next-line callback-return
|
|
5466
|
+
}); // eslint-disable-next-line node/callback-return
|
|
5437
5467
|
|
|
5438
5468
|
cb();
|
|
5439
5469
|
internalStateObjPropsToIgnore.forEach(function (prop, i) {
|
|
@@ -5443,13 +5473,13 @@
|
|
|
5443
5473
|
/**
|
|
5444
5474
|
*
|
|
5445
5475
|
* @param {string} keypath
|
|
5446
|
-
* @param {
|
|
5476
|
+
* @param {any} value
|
|
5447
5477
|
* @param {boolean} cyclic
|
|
5448
5478
|
* @param {PlainObject} stateObj
|
|
5449
5479
|
* @param {boolean} promisesData
|
|
5450
5480
|
* @param {boolean} resolvingTypesonPromise
|
|
5451
5481
|
* @param {string} detectedType
|
|
5452
|
-
* @returns {
|
|
5482
|
+
* @returns {any}
|
|
5453
5483
|
*/
|
|
5454
5484
|
|
|
5455
5485
|
|
|
@@ -5457,7 +5487,7 @@
|
|
|
5457
5487
|
var ret;
|
|
5458
5488
|
var observerData = {};
|
|
5459
5489
|
|
|
5460
|
-
var $typeof = _typeof
|
|
5490
|
+
var $typeof = _typeof(value);
|
|
5461
5491
|
|
|
5462
5492
|
var runObserver = encapsulateObserver ? function (obj) {
|
|
5463
5493
|
var type = detectedType || stateObj.type || Typeson.getJSONType(value);
|
|
@@ -5475,12 +5505,8 @@
|
|
|
5475
5505
|
} : null;
|
|
5476
5506
|
|
|
5477
5507
|
if (['string', 'boolean', 'number', 'undefined'].includes($typeof)) {
|
|
5478
|
-
if (value === undefined ||
|
|
5479
|
-
|
|
5480
|
-
ret = value;
|
|
5481
|
-
} else {
|
|
5482
|
-
ret = replace(keypath, value, stateObj, promisesData, false, resolvingTypesonPromise, runObserver);
|
|
5483
|
-
}
|
|
5508
|
+
if (value === undefined || Number.isNaN(value) || value === Number.NEGATIVE_INFINITY || value === Number.POSITIVE_INFINITY) {
|
|
5509
|
+
ret = stateObj.replaced ? value : replace(keypath, value, stateObj, promisesData, false, resolvingTypesonPromise, runObserver);
|
|
5484
5510
|
|
|
5485
5511
|
if (ret !== value) {
|
|
5486
5512
|
observerData = {
|
|
@@ -5506,7 +5532,7 @@
|
|
|
5506
5532
|
return value;
|
|
5507
5533
|
}
|
|
5508
5534
|
|
|
5509
|
-
if (cyclic && !stateObj.iterateIn && !stateObj.iterateUnsetNumeric && value && _typeof
|
|
5535
|
+
if (cyclic && !stateObj.iterateIn && !stateObj.iterateUnsetNumeric && value && _typeof(value) === 'object') {
|
|
5510
5536
|
// Options set to detect cyclic references and be able
|
|
5511
5537
|
// to rewrite them.
|
|
5512
5538
|
var refIndex = refObjs.indexOf(value);
|
|
@@ -5549,11 +5575,12 @@
|
|
|
5549
5575
|
promisesData.push([keypath, value, cyclic, stateObj, undefined, undefined, stateObj.type]);
|
|
5550
5576
|
ret = value;
|
|
5551
5577
|
} else if (isArr && stateObj.iterateIn !== 'object' || stateObj.iterateIn === 'array') {
|
|
5578
|
+
// eslint-disable-next-line unicorn/no-new-array -- Sparse
|
|
5552
5579
|
clone = new Array(value.length);
|
|
5553
5580
|
observerData = {
|
|
5554
5581
|
clone: clone
|
|
5555
5582
|
};
|
|
5556
|
-
} else if (!['function', 'symbol'].includes(_typeof
|
|
5583
|
+
} else if (!['function', 'symbol'].includes(_typeof(value)) && !('toJSON' in value) && !hasConstructorOf(value, TypesonPromise) && !hasConstructorOf(value, Promise) && !hasConstructorOf(value, ArrayBuffer) || isPlainObj || stateObj.iterateIn === 'object') {
|
|
5557
5584
|
clone = {};
|
|
5558
5585
|
|
|
5559
5586
|
if (stateObj.addLength) {
|
|
@@ -5584,7 +5611,7 @@
|
|
|
5584
5611
|
if (stateObj.iterateIn) {
|
|
5585
5612
|
var _loop = function _loop(key) {
|
|
5586
5613
|
var ownKeysObj = {
|
|
5587
|
-
ownKeys: hasOwn
|
|
5614
|
+
ownKeys: hasOwn.call(value, key)
|
|
5588
5615
|
};
|
|
5589
5616
|
|
|
5590
5617
|
_adaptBuiltinStateObjectProperties(stateObj, ownKeysObj, function () {
|
|
@@ -5681,16 +5708,50 @@
|
|
|
5681
5708
|
|
|
5682
5709
|
return clone;
|
|
5683
5710
|
}
|
|
5711
|
+
/**
|
|
5712
|
+
* @typedef {PlainObject} KeyPathEvent
|
|
5713
|
+
* @property {string} cyclicKeypath
|
|
5714
|
+
*/
|
|
5715
|
+
|
|
5716
|
+
/**
|
|
5717
|
+
* @typedef {PlainObject} EndIterateInEvent
|
|
5718
|
+
* @property {boolean} endIterateIn
|
|
5719
|
+
* @property {boolean} end
|
|
5720
|
+
*/
|
|
5721
|
+
|
|
5722
|
+
/**
|
|
5723
|
+
* @typedef {PlainObject} EndIterateUnsetNumericEvent
|
|
5724
|
+
* @property {boolean} endIterateUnsetNumeric
|
|
5725
|
+
* @property {boolean} end
|
|
5726
|
+
*/
|
|
5727
|
+
|
|
5728
|
+
/**
|
|
5729
|
+
* @typedef {PlainObject} TypeDetectedEvent
|
|
5730
|
+
* @property {boolean} typeDetected
|
|
5731
|
+
*/
|
|
5732
|
+
|
|
5733
|
+
/**
|
|
5734
|
+
* @typedef {PlainObject} ReplacingEvent
|
|
5735
|
+
* @property {boolean} replacing
|
|
5736
|
+
*/
|
|
5737
|
+
|
|
5738
|
+
/**
|
|
5739
|
+
* @callback Observer
|
|
5740
|
+
* @param {KeyPathEvent|EndIterateInEvent|EndIterateUnsetNumericEvent|
|
|
5741
|
+
* TypeDetectedEvent|ReplacingEvent} [event]
|
|
5742
|
+
* @returns {void}
|
|
5743
|
+
*/
|
|
5744
|
+
|
|
5684
5745
|
/**
|
|
5685
5746
|
*
|
|
5686
5747
|
* @param {string} keypath
|
|
5687
|
-
* @param {
|
|
5748
|
+
* @param {any} value
|
|
5688
5749
|
* @param {PlainObject} stateObj
|
|
5689
5750
|
* @param {GenericArray} promisesData
|
|
5690
5751
|
* @param {boolean} plainObject
|
|
5691
5752
|
* @param {boolean} resolvingTypesonPromise
|
|
5692
|
-
* @param {
|
|
5693
|
-
* @returns {
|
|
5753
|
+
* @param {Observer} [runObserver]
|
|
5754
|
+
* @returns {any}
|
|
5694
5755
|
*/
|
|
5695
5756
|
|
|
5696
5757
|
|
|
@@ -5761,46 +5822,47 @@
|
|
|
5761
5822
|
}
|
|
5762
5823
|
/**
|
|
5763
5824
|
* Also sync but throws on non-sync result.
|
|
5764
|
-
* @param {
|
|
5765
|
-
* @param {
|
|
5766
|
-
* @param {
|
|
5767
|
-
* @returns {
|
|
5825
|
+
* @param {any} obj
|
|
5826
|
+
* @param {StateObject} stateObj
|
|
5827
|
+
* @param {TypesonOptions} opts
|
|
5828
|
+
* @returns {any}
|
|
5768
5829
|
*/
|
|
5769
5830
|
|
|
5770
5831
|
}, {
|
|
5771
5832
|
key: "encapsulateSync",
|
|
5772
5833
|
value: function encapsulateSync(obj, stateObj, opts) {
|
|
5773
|
-
return this.encapsulate(obj, stateObj, _objectSpread2({
|
|
5834
|
+
return this.encapsulate(obj, stateObj, _objectSpread2(_objectSpread2({
|
|
5774
5835
|
throwOnBadSyncType: true
|
|
5775
|
-
}, opts, {
|
|
5836
|
+
}, opts), {}, {
|
|
5776
5837
|
sync: true
|
|
5777
5838
|
}));
|
|
5778
5839
|
}
|
|
5779
5840
|
/**
|
|
5780
|
-
* @param {
|
|
5781
|
-
* @param {
|
|
5782
|
-
* @param {
|
|
5783
|
-
* @returns {
|
|
5841
|
+
* @param {any} obj
|
|
5842
|
+
* @param {StateObject} stateObj
|
|
5843
|
+
* @param {TypesonOptions} opts
|
|
5844
|
+
* @returns {any}
|
|
5784
5845
|
*/
|
|
5785
5846
|
|
|
5786
5847
|
}, {
|
|
5787
5848
|
key: "encapsulateAsync",
|
|
5788
5849
|
value: function encapsulateAsync(obj, stateObj, opts) {
|
|
5789
|
-
return this.encapsulate(obj, stateObj, _objectSpread2({
|
|
5850
|
+
return this.encapsulate(obj, stateObj, _objectSpread2(_objectSpread2({
|
|
5790
5851
|
throwOnBadSyncType: true
|
|
5791
|
-
}, opts, {
|
|
5852
|
+
}, opts), {}, {
|
|
5792
5853
|
sync: false
|
|
5793
5854
|
}));
|
|
5794
5855
|
}
|
|
5795
5856
|
/**
|
|
5796
5857
|
* Revive an encapsulated object.
|
|
5797
5858
|
* This method is used internally by `Typeson.parse()`.
|
|
5798
|
-
* @param {
|
|
5799
|
-
* properties that are listed there will be replaced with its true
|
|
5800
|
-
* instead of just plain objects.
|
|
5801
|
-
* @param {
|
|
5859
|
+
* @param {PlainObject} obj - Object to revive. If it has `$types` member,
|
|
5860
|
+
* the properties that are listed there will be replaced with its true
|
|
5861
|
+
* type instead of just plain objects.
|
|
5862
|
+
* @param {TypesonOptions} opts
|
|
5802
5863
|
* @throws TypeError If mismatch between sync/async type and result
|
|
5803
|
-
* @returns {Promise
|
|
5864
|
+
* @returns {Promise<any>|any} If async, returns a Promise that resolves
|
|
5865
|
+
* to `any`.
|
|
5804
5866
|
*/
|
|
5805
5867
|
|
|
5806
5868
|
}, {
|
|
@@ -5818,9 +5880,9 @@
|
|
|
5818
5880
|
return obj.$;
|
|
5819
5881
|
}
|
|
5820
5882
|
|
|
5821
|
-
opts = _objectSpread2({
|
|
5883
|
+
opts = _objectSpread2(_objectSpread2({
|
|
5822
5884
|
sync: true
|
|
5823
|
-
}, this.options,
|
|
5885
|
+
}, this.options), opts);
|
|
5824
5886
|
var _opts3 = opts,
|
|
5825
5887
|
sync = _opts3.sync;
|
|
5826
5888
|
var keyPathResolutions = [];
|
|
@@ -5838,22 +5900,23 @@
|
|
|
5838
5900
|
var that = this;
|
|
5839
5901
|
/**
|
|
5840
5902
|
* @callback RevivalReducer
|
|
5841
|
-
* @param {
|
|
5903
|
+
* @param {any} value
|
|
5842
5904
|
* @param {string} type
|
|
5843
|
-
* @returns {
|
|
5905
|
+
* @returns {any}
|
|
5844
5906
|
*/
|
|
5845
5907
|
|
|
5846
5908
|
/**
|
|
5847
5909
|
*
|
|
5848
5910
|
* @param {string} type
|
|
5849
|
-
* @param {
|
|
5850
|
-
* @
|
|
5911
|
+
* @param {any} val
|
|
5912
|
+
* @throws {Error}
|
|
5913
|
+
* @returns {any}
|
|
5851
5914
|
*/
|
|
5852
5915
|
|
|
5853
5916
|
function executeReviver(type, val) {
|
|
5854
|
-
var
|
|
5855
|
-
|
|
5856
|
-
reviver =
|
|
5917
|
+
var _ref = that.revivers[type] || [],
|
|
5918
|
+
_ref2 = _slicedToArray(_ref, 1),
|
|
5919
|
+
reviver = _ref2[0];
|
|
5857
5920
|
|
|
5858
5921
|
if (!reviver) {
|
|
5859
5922
|
throw new Error('Unregistered type: ' + type);
|
|
@@ -5880,10 +5943,10 @@
|
|
|
5880
5943
|
// const references = [];
|
|
5881
5944
|
// const reviveTypes = [];
|
|
5882
5945
|
var plainObjectTypes = [];
|
|
5883
|
-
Object.entries(types).forEach(function (
|
|
5884
|
-
var
|
|
5885
|
-
keypath =
|
|
5886
|
-
type =
|
|
5946
|
+
Object.entries(types).forEach(function (_ref3) {
|
|
5947
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
5948
|
+
keypath = _ref4[0],
|
|
5949
|
+
type = _ref4[1];
|
|
5887
5950
|
|
|
5888
5951
|
if (type === '#') {
|
|
5889
5952
|
/*
|
|
@@ -5896,9 +5959,9 @@
|
|
|
5896
5959
|
}
|
|
5897
5960
|
|
|
5898
5961
|
[].concat(type).forEach(function (type) {
|
|
5899
|
-
var
|
|
5900
|
-
|
|
5901
|
-
plain =
|
|
5962
|
+
var _ref5 = that.revivers[type] || [null, {}],
|
|
5963
|
+
_ref6 = _slicedToArray(_ref5, 2),
|
|
5964
|
+
plain = _ref6[1].plain;
|
|
5902
5965
|
|
|
5903
5966
|
if (!plain) {
|
|
5904
5967
|
// reviveTypes.push({keypath, type});
|
|
@@ -5924,9 +5987,9 @@
|
|
|
5924
5987
|
*/
|
|
5925
5988
|
|
|
5926
5989
|
|
|
5927
|
-
return plainObjectTypes.sort(nestedPathsFirst).reduce(function reducer(possibleTypesonPromise,
|
|
5928
|
-
var keypath =
|
|
5929
|
-
type =
|
|
5990
|
+
return plainObjectTypes.sort(nestedPathsFirst).reduce(function reducer(possibleTypesonPromise, _ref7) {
|
|
5991
|
+
var keypath = _ref7.keypath,
|
|
5992
|
+
type = _ref7.type;
|
|
5930
5993
|
|
|
5931
5994
|
if (isThenable(possibleTypesonPromise)) {
|
|
5932
5995
|
return possibleTypesonPromise.then(function (val) {
|
|
@@ -5969,11 +6032,11 @@
|
|
|
5969
6032
|
/**
|
|
5970
6033
|
*
|
|
5971
6034
|
* @param {string} keypath
|
|
5972
|
-
* @param {
|
|
5973
|
-
* @param {?(
|
|
5974
|
-
* @param {
|
|
6035
|
+
* @param {any} value
|
|
6036
|
+
* @param {?(GenericArray|PlainObject)} target
|
|
6037
|
+
* @param {GenericArray|PlainObject} [clone]
|
|
5975
6038
|
* @param {string} [key]
|
|
5976
|
-
* @returns {
|
|
6039
|
+
* @returns {any}
|
|
5977
6040
|
*/
|
|
5978
6041
|
|
|
5979
6042
|
function _revive(keypath, value, target, clone, key) {
|
|
@@ -5985,6 +6048,7 @@
|
|
|
5985
6048
|
var isArr = isArray(value);
|
|
5986
6049
|
|
|
5987
6050
|
if (isArr || isPlainObject(value)) {
|
|
6051
|
+
// eslint-disable-next-line unicorn/no-new-array -- Sparse
|
|
5988
6052
|
var _clone = isArr ? new Array(value.length) : {}; // Iterate object or array
|
|
5989
6053
|
|
|
5990
6054
|
|
|
@@ -6060,8 +6124,8 @@
|
|
|
6060
6124
|
}
|
|
6061
6125
|
/**
|
|
6062
6126
|
*
|
|
6063
|
-
* @param {
|
|
6064
|
-
* @returns {undefined|
|
|
6127
|
+
* @param {any} retrn
|
|
6128
|
+
* @returns {undefined|any}
|
|
6065
6129
|
*/
|
|
6066
6130
|
|
|
6067
6131
|
|
|
@@ -6084,9 +6148,9 @@
|
|
|
6084
6148
|
ret = TypesonPromise.resolve(ret).then(function (r) {
|
|
6085
6149
|
return TypesonPromise.all([// May be a TypesonPromise or not
|
|
6086
6150
|
r].concat(revivalPromises));
|
|
6087
|
-
}).then(function (
|
|
6088
|
-
var
|
|
6089
|
-
r =
|
|
6151
|
+
}).then(function (_ref8) {
|
|
6152
|
+
var _ref9 = _slicedToArray(_ref8, 1),
|
|
6153
|
+
r = _ref9[0];
|
|
6090
6154
|
|
|
6091
6155
|
return r;
|
|
6092
6156
|
});
|
|
@@ -6101,42 +6165,46 @@
|
|
|
6101
6165
|
}
|
|
6102
6166
|
/**
|
|
6103
6167
|
* Also sync but throws on non-sync result.
|
|
6104
|
-
* @param {
|
|
6105
|
-
* @param {
|
|
6106
|
-
* @returns {
|
|
6168
|
+
* @param {any} obj
|
|
6169
|
+
* @param {TypesonOptions} opts
|
|
6170
|
+
* @returns {any}
|
|
6107
6171
|
*/
|
|
6108
6172
|
|
|
6109
6173
|
}, {
|
|
6110
6174
|
key: "reviveSync",
|
|
6111
6175
|
value: function reviveSync(obj, opts) {
|
|
6112
|
-
return this.revive(obj, _objectSpread2({
|
|
6176
|
+
return this.revive(obj, _objectSpread2(_objectSpread2({
|
|
6113
6177
|
throwOnBadSyncType: true
|
|
6114
|
-
}, opts, {
|
|
6178
|
+
}, opts), {}, {
|
|
6115
6179
|
sync: true
|
|
6116
6180
|
}));
|
|
6117
6181
|
}
|
|
6118
6182
|
/**
|
|
6119
|
-
* @param {
|
|
6120
|
-
* @param {
|
|
6121
|
-
* @returns {Promise}
|
|
6183
|
+
* @param {any} obj
|
|
6184
|
+
* @param {TypesonOptions} opts
|
|
6185
|
+
* @returns {Promise<any>}
|
|
6122
6186
|
*/
|
|
6123
6187
|
|
|
6124
6188
|
}, {
|
|
6125
6189
|
key: "reviveAsync",
|
|
6126
6190
|
value: function reviveAsync(obj, opts) {
|
|
6127
|
-
return this.revive(obj, _objectSpread2({
|
|
6191
|
+
return this.revive(obj, _objectSpread2(_objectSpread2({
|
|
6128
6192
|
throwOnBadSyncType: true
|
|
6129
|
-
}, opts, {
|
|
6193
|
+
}, opts), {}, {
|
|
6130
6194
|
sync: false
|
|
6131
6195
|
}));
|
|
6132
6196
|
}
|
|
6197
|
+
/**
|
|
6198
|
+
* @typedef {Tester|Replacer|Reviver} Spec
|
|
6199
|
+
*/
|
|
6200
|
+
|
|
6133
6201
|
/**
|
|
6134
6202
|
* Register types.
|
|
6135
6203
|
* For examples on how to use this method, see
|
|
6136
6204
|
* {@link https://github.com/dfahlander/typeson-registry/tree/master/types}.
|
|
6137
|
-
* @param {object
|
|
6138
|
-
*
|
|
6139
|
-
* @param {
|
|
6205
|
+
* @param {object<string,Spec[]>[]} typeSpecSets -
|
|
6206
|
+
* Types and their functions [test, encapsulate, revive];
|
|
6207
|
+
* @param {TypesonOptions} opts
|
|
6140
6208
|
* @returns {Typeson}
|
|
6141
6209
|
*/
|
|
6142
6210
|
|
|
@@ -6219,7 +6287,7 @@
|
|
|
6219
6287
|
replacerObj.replaceAsync = spec.replaceAsync.bind(spec);
|
|
6220
6288
|
}
|
|
6221
6289
|
|
|
6222
|
-
var start = typeof opts.fallback === 'number' ? opts.fallback : opts.fallback ? 0 :
|
|
6290
|
+
var start = typeof opts.fallback === 'number' ? opts.fallback : opts.fallback ? 0 : Number.POSITIVE_INFINITY;
|
|
6223
6291
|
|
|
6224
6292
|
if (spec.testPlainObjects) {
|
|
6225
6293
|
this.plainObjectReplacers.splice(start, 0, replacerObj);
|
|
@@ -6287,9 +6355,9 @@
|
|
|
6287
6355
|
Typeson.JSON_TYPES = ['null', 'boolean', 'number', 'string', 'array', 'object'];
|
|
6288
6356
|
return Typeson;
|
|
6289
6357
|
});
|
|
6290
|
-
});
|
|
6358
|
+
})(typeson$1);
|
|
6291
6359
|
|
|
6292
|
-
|
|
6360
|
+
var Typeson = typeson$1.exports;
|
|
6293
6361
|
|
|
6294
6362
|
/*
|
|
6295
6363
|
* base64-arraybuffer
|
|
@@ -6313,7 +6381,7 @@
|
|
|
6313
6381
|
*/
|
|
6314
6382
|
|
|
6315
6383
|
|
|
6316
|
-
var encode = function encode(arraybuffer, byteOffset, lngth) {
|
|
6384
|
+
var encode$1 = function encode(arraybuffer, byteOffset, lngth) {
|
|
6317
6385
|
if (lngth === null || lngth === undefined) {
|
|
6318
6386
|
lngth = arraybuffer.byteLength; // Needed for Safari
|
|
6319
6387
|
}
|
|
@@ -6344,7 +6412,7 @@
|
|
|
6344
6412
|
*/
|
|
6345
6413
|
|
|
6346
6414
|
|
|
6347
|
-
var decode = function decode(base64) {
|
|
6415
|
+
var decode$1 = function decode(base64) {
|
|
6348
6416
|
var len = base64.length;
|
|
6349
6417
|
var bufferLength = base64.length * 0.75;
|
|
6350
6418
|
var p = 0;
|
|
@@ -6377,7 +6445,7 @@
|
|
|
6377
6445
|
var arraybuffer = {
|
|
6378
6446
|
arraybuffer: {
|
|
6379
6447
|
test: function test(x) {
|
|
6380
|
-
return
|
|
6448
|
+
return Typeson.toStringTag(x) === 'ArrayBuffer';
|
|
6381
6449
|
},
|
|
6382
6450
|
replace: function replace(b, stateObj) {
|
|
6383
6451
|
if (!stateObj.buffers) {
|
|
@@ -6393,18 +6461,18 @@
|
|
|
6393
6461
|
}
|
|
6394
6462
|
|
|
6395
6463
|
stateObj.buffers.push(b);
|
|
6396
|
-
return encode(b);
|
|
6464
|
+
return encode$1(b);
|
|
6397
6465
|
},
|
|
6398
6466
|
revive: function revive(b64, stateObj) {
|
|
6399
6467
|
if (!stateObj.buffers) {
|
|
6400
6468
|
stateObj.buffers = [];
|
|
6401
6469
|
}
|
|
6402
6470
|
|
|
6403
|
-
if (_typeof(b64) === 'object') {
|
|
6471
|
+
if (_typeof$1(b64) === 'object') {
|
|
6404
6472
|
return stateObj.buffers[b64.index];
|
|
6405
6473
|
}
|
|
6406
6474
|
|
|
6407
|
-
var buffer = decode(b64);
|
|
6475
|
+
var buffer = decode$1(b64);
|
|
6408
6476
|
stateObj.buffers.push(buffer);
|
|
6409
6477
|
return buffer;
|
|
6410
6478
|
}
|
|
@@ -6415,7 +6483,7 @@
|
|
|
6415
6483
|
var bigintObject = {
|
|
6416
6484
|
bigintObject: {
|
|
6417
6485
|
test: function test(x) {
|
|
6418
|
-
return _typeof(x) === 'object' &&
|
|
6486
|
+
return _typeof$1(x) === 'object' && Typeson.hasConstructorOf(x, BigInt);
|
|
6419
6487
|
},
|
|
6420
6488
|
replace: function replace(n) {
|
|
6421
6489
|
return String(n);
|
|
@@ -6514,14 +6582,12 @@
|
|
|
6514
6582
|
var blob = {
|
|
6515
6583
|
blob: {
|
|
6516
6584
|
test: function test(x) {
|
|
6517
|
-
return
|
|
6585
|
+
return Typeson.toStringTag(x) === 'Blob';
|
|
6518
6586
|
},
|
|
6519
6587
|
replace: function replace(b) {
|
|
6520
6588
|
// Sync
|
|
6521
6589
|
var req = new XMLHttpRequest();
|
|
6522
|
-
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
6523
|
-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
6524
|
-
|
|
6590
|
+
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
6525
6591
|
req.open('GET', URL.createObjectURL(b), false); // Sync
|
|
6526
6592
|
|
|
6527
6593
|
req.send(); // Seems not feasible to accurately simulate
|
|
@@ -6545,7 +6611,7 @@
|
|
|
6545
6611
|
});
|
|
6546
6612
|
},
|
|
6547
6613
|
replaceAsync: function replaceAsync(b) {
|
|
6548
|
-
return new
|
|
6614
|
+
return new Typeson.Promise(function (resolve, reject) {
|
|
6549
6615
|
/*
|
|
6550
6616
|
if (b.isClosed) { // On MDN, but not in https://w3c.github.io/FileAPI/#dfn-Blob
|
|
6551
6617
|
reject(new Error('The Blob is closed'));
|
|
@@ -6585,11 +6651,12 @@
|
|
|
6585
6651
|
// Adapted from original: public domain/MIT: http://stackoverflow.com/a/8809472/271577
|
|
6586
6652
|
|
|
6587
6653
|
/* istanbul ignore next */
|
|
6588
|
-
var d =
|
|
6654
|
+
var d = Date.now() + ( // use high-precision timer if available
|
|
6655
|
+
// istanbul ignore next
|
|
6589
6656
|
typeof performance !== 'undefined' && typeof performance.now === 'function' ? performance.now() : 0);
|
|
6590
6657
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
6591
6658
|
/* eslint-disable no-bitwise */
|
|
6592
|
-
var r = (d + Math.random() * 16) % 16
|
|
6659
|
+
var r = Math.trunc((d + Math.random() * 16) % 16);
|
|
6593
6660
|
d = Math.floor(d / 16);
|
|
6594
6661
|
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
6595
6662
|
/* eslint-enable no-bitwise */
|
|
@@ -6600,7 +6667,7 @@
|
|
|
6600
6667
|
var cloneable = {
|
|
6601
6668
|
cloneable: {
|
|
6602
6669
|
test: function test(x) {
|
|
6603
|
-
return x && _typeof(x) === 'object' && typeof x[Symbol["for"]('cloneEncapsulate')] === 'function';
|
|
6670
|
+
return x && _typeof$1(x) === 'object' && typeof x[Symbol["for"]('cloneEncapsulate')] === 'function';
|
|
6604
6671
|
},
|
|
6605
6672
|
replace: function replace(clonable) {
|
|
6606
6673
|
var encapsulated = clonable[Symbol["for"]('cloneEncapsulate')]();
|
|
@@ -6619,10 +6686,47 @@
|
|
|
6619
6686
|
}
|
|
6620
6687
|
};
|
|
6621
6688
|
|
|
6689
|
+
/* globals crypto */
|
|
6690
|
+
var cryptokey = {
|
|
6691
|
+
cryptokey: {
|
|
6692
|
+
test: function test(x) {
|
|
6693
|
+
return Typeson.toStringTag(x) === 'CryptoKey' && x.extractable;
|
|
6694
|
+
},
|
|
6695
|
+
replaceAsync: function replaceAsync(key) {
|
|
6696
|
+
return new Typeson.Promise(function (resolve, reject) {
|
|
6697
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
6698
|
+
crypto.subtle.exportKey('jwk', key)["catch"](
|
|
6699
|
+
/* eslint-disable promise/prefer-await-to-callbacks */
|
|
6700
|
+
// istanbul ignore next
|
|
6701
|
+
function (err) {
|
|
6702
|
+
/* eslint-enable promise/prefer-await-to-callbacks */
|
|
6703
|
+
// eslint-disable-next-line max-len
|
|
6704
|
+
// istanbul ignore next -- Our format should be valid and our key extractable
|
|
6705
|
+
reject(err);
|
|
6706
|
+
} // eslint-disable-next-line max-len
|
|
6707
|
+
// eslint-disable-next-line promise/always-return, promise/prefer-await-to-then
|
|
6708
|
+
).then(function (jwk) {
|
|
6709
|
+
resolve({
|
|
6710
|
+
jwk: jwk,
|
|
6711
|
+
algorithm: key.algorithm,
|
|
6712
|
+
usages: key.usages
|
|
6713
|
+
});
|
|
6714
|
+
});
|
|
6715
|
+
});
|
|
6716
|
+
},
|
|
6717
|
+
revive: function revive(_ref) {
|
|
6718
|
+
var jwk = _ref.jwk,
|
|
6719
|
+
algorithm = _ref.algorithm,
|
|
6720
|
+
usages = _ref.usages;
|
|
6721
|
+
return crypto.subtle.importKey('jwk', jwk, algorithm, true, usages);
|
|
6722
|
+
}
|
|
6723
|
+
}
|
|
6724
|
+
};
|
|
6725
|
+
|
|
6622
6726
|
var dataview = {
|
|
6623
6727
|
dataview: {
|
|
6624
6728
|
test: function test(x) {
|
|
6625
|
-
return
|
|
6729
|
+
return Typeson.toStringTag(x) === 'DataView';
|
|
6626
6730
|
},
|
|
6627
6731
|
replace: function replace(_ref, stateObj) {
|
|
6628
6732
|
var buffer = _ref.buffer,
|
|
@@ -6645,7 +6749,7 @@
|
|
|
6645
6749
|
|
|
6646
6750
|
stateObj.buffers.push(buffer);
|
|
6647
6751
|
return {
|
|
6648
|
-
encoded: encode(buffer),
|
|
6752
|
+
encoded: encode$1(buffer),
|
|
6649
6753
|
byteOffset: byteOffset,
|
|
6650
6754
|
byteLength: byteLength
|
|
6651
6755
|
};
|
|
@@ -6664,7 +6768,7 @@
|
|
|
6664
6768
|
if ('index' in b64Obj) {
|
|
6665
6769
|
buffer = stateObj.buffers[index];
|
|
6666
6770
|
} else {
|
|
6667
|
-
buffer = decode(encoded);
|
|
6771
|
+
buffer = decode$1(encoded);
|
|
6668
6772
|
stateObj.buffers.push(buffer);
|
|
6669
6773
|
}
|
|
6670
6774
|
|
|
@@ -6676,7 +6780,7 @@
|
|
|
6676
6780
|
var date = {
|
|
6677
6781
|
date: {
|
|
6678
6782
|
test: function test(x) {
|
|
6679
|
-
return
|
|
6783
|
+
return Typeson.toStringTag(x) === 'Date';
|
|
6680
6784
|
},
|
|
6681
6785
|
replace: function replace(dt) {
|
|
6682
6786
|
var time = dt.getTime();
|
|
@@ -6700,7 +6804,7 @@
|
|
|
6700
6804
|
var error = {
|
|
6701
6805
|
error: {
|
|
6702
6806
|
test: function test(x) {
|
|
6703
|
-
return
|
|
6807
|
+
return Typeson.toStringTag(x) === 'Error';
|
|
6704
6808
|
},
|
|
6705
6809
|
replace: function replace(_ref) {
|
|
6706
6810
|
var name = _ref.name,
|
|
@@ -6722,18 +6826,18 @@
|
|
|
6722
6826
|
|
|
6723
6827
|
/* istanbul ignore next */
|
|
6724
6828
|
|
|
6725
|
-
var _global = typeof self === 'undefined' ? global$
|
|
6829
|
+
var _global$2 = typeof self === 'undefined' ? global$1 : self;
|
|
6726
6830
|
|
|
6727
6831
|
var errors = {}; // Comprises all built-in errors.
|
|
6728
6832
|
|
|
6729
6833
|
['TypeError', 'RangeError', 'SyntaxError', 'ReferenceError', 'EvalError', 'URIError', 'InternalError' // non-standard
|
|
6730
6834
|
].forEach(function (errName) {
|
|
6731
|
-
var Cnstrctr = _global[errName];
|
|
6835
|
+
var Cnstrctr = _global$2[errName];
|
|
6732
6836
|
|
|
6733
6837
|
if (Cnstrctr) {
|
|
6734
6838
|
errors[errName.toLowerCase()] = {
|
|
6735
6839
|
test: function test(x) {
|
|
6736
|
-
return
|
|
6840
|
+
return Typeson.hasConstructorOf(x, Cnstrctr);
|
|
6737
6841
|
},
|
|
6738
6842
|
replace: function replace(e) {
|
|
6739
6843
|
return e.message;
|
|
@@ -6749,14 +6853,12 @@
|
|
|
6749
6853
|
var file = {
|
|
6750
6854
|
file: {
|
|
6751
6855
|
test: function test(x) {
|
|
6752
|
-
return
|
|
6856
|
+
return Typeson.toStringTag(x) === 'File';
|
|
6753
6857
|
},
|
|
6754
6858
|
replace: function replace(f) {
|
|
6755
6859
|
// Sync
|
|
6756
6860
|
var req = new XMLHttpRequest();
|
|
6757
|
-
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
6758
|
-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
6759
|
-
|
|
6861
|
+
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
6760
6862
|
req.open('GET', URL.createObjectURL(f), false); // Sync
|
|
6761
6863
|
|
|
6762
6864
|
req.send(); // Seems not feasible to accurately simulate
|
|
@@ -6785,7 +6887,7 @@
|
|
|
6785
6887
|
});
|
|
6786
6888
|
},
|
|
6787
6889
|
replaceAsync: function replaceAsync(f) {
|
|
6788
|
-
return new
|
|
6890
|
+
return new Typeson.Promise(function (resolve, reject) {
|
|
6789
6891
|
/*
|
|
6790
6892
|
if (f.isClosed) { // On MDN, but not in https://w3c.github.io/FileAPI/#dfn-Blob
|
|
6791
6893
|
reject(new Error('The File is closed'));
|
|
@@ -6817,7 +6919,7 @@
|
|
|
6817
6919
|
file: file.file,
|
|
6818
6920
|
filelist: {
|
|
6819
6921
|
test: function test(x) {
|
|
6820
|
-
return
|
|
6922
|
+
return Typeson.toStringTag(x) === 'FileList';
|
|
6821
6923
|
},
|
|
6822
6924
|
replace: function replace(fl) {
|
|
6823
6925
|
var arr = [];
|
|
@@ -6832,7 +6934,7 @@
|
|
|
6832
6934
|
/**
|
|
6833
6935
|
* `FileList` polyfill.
|
|
6834
6936
|
*/
|
|
6835
|
-
var FileList = /*#__PURE__*/function () {
|
|
6937
|
+
var FileList = /*#__PURE__*/function (_Symbol$toStringTag) {
|
|
6836
6938
|
/**
|
|
6837
6939
|
* Set private properties and length.
|
|
6838
6940
|
*/
|
|
@@ -6861,7 +6963,7 @@
|
|
|
6861
6963
|
*/
|
|
6862
6964
|
|
|
6863
6965
|
}, {
|
|
6864
|
-
key:
|
|
6966
|
+
key: _Symbol$toStringTag,
|
|
6865
6967
|
get: function get() {
|
|
6866
6968
|
/* eslint-enable class-methods-use-this */
|
|
6867
6969
|
return 'FileList';
|
|
@@ -6869,7 +6971,7 @@
|
|
|
6869
6971
|
}]);
|
|
6870
6972
|
|
|
6871
6973
|
return FileList;
|
|
6872
|
-
}();
|
|
6974
|
+
}(Symbol.toStringTag);
|
|
6873
6975
|
|
|
6874
6976
|
return new FileList(o);
|
|
6875
6977
|
}
|
|
@@ -6880,7 +6982,7 @@
|
|
|
6880
6982
|
var imagebitmap = {
|
|
6881
6983
|
imagebitmap: {
|
|
6882
6984
|
test: function test(x) {
|
|
6883
|
-
return
|
|
6985
|
+
return Typeson.toStringTag(x) === 'ImageBitmap' || // In Node, our polyfill sets the dataset on a canvas
|
|
6884
6986
|
// element as JSDom no longer allows overriding toStringTag
|
|
6885
6987
|
x && x.dataset && x.dataset.toStringTag === 'ImageBitmap';
|
|
6886
6988
|
},
|
|
@@ -6936,7 +7038,7 @@
|
|
|
6936
7038
|
var imagedata = {
|
|
6937
7039
|
imagedata: {
|
|
6938
7040
|
test: function test(x) {
|
|
6939
|
-
return
|
|
7041
|
+
return Typeson.toStringTag(x) === 'ImageData';
|
|
6940
7042
|
},
|
|
6941
7043
|
replace: function replace(d) {
|
|
6942
7044
|
return {
|
|
@@ -6955,20 +7057,20 @@
|
|
|
6955
7057
|
var infinity = {
|
|
6956
7058
|
infinity: {
|
|
6957
7059
|
test: function test(x) {
|
|
6958
|
-
return x ===
|
|
7060
|
+
return x === Number.POSITIVE_INFINITY;
|
|
6959
7061
|
},
|
|
6960
7062
|
replace: function replace(n) {
|
|
6961
7063
|
return 'Infinity';
|
|
6962
7064
|
},
|
|
6963
7065
|
revive: function revive(s) {
|
|
6964
|
-
return
|
|
7066
|
+
return Number.POSITIVE_INFINITY;
|
|
6965
7067
|
}
|
|
6966
7068
|
}
|
|
6967
7069
|
};
|
|
6968
7070
|
|
|
6969
7071
|
var IntlCollator = {
|
|
6970
7072
|
test: function test(x) {
|
|
6971
|
-
return
|
|
7073
|
+
return Typeson.hasConstructorOf(x, Intl.Collator);
|
|
6972
7074
|
},
|
|
6973
7075
|
replace: function replace(c) {
|
|
6974
7076
|
return c.resolvedOptions();
|
|
@@ -6979,7 +7081,7 @@
|
|
|
6979
7081
|
};
|
|
6980
7082
|
var IntlDateTimeFormat = {
|
|
6981
7083
|
test: function test(x) {
|
|
6982
|
-
return
|
|
7084
|
+
return Typeson.hasConstructorOf(x, Intl.DateTimeFormat);
|
|
6983
7085
|
},
|
|
6984
7086
|
replace: function replace(dtf) {
|
|
6985
7087
|
return dtf.resolvedOptions();
|
|
@@ -6990,7 +7092,7 @@
|
|
|
6990
7092
|
};
|
|
6991
7093
|
var IntlNumberFormat = {
|
|
6992
7094
|
test: function test(x) {
|
|
6993
|
-
return
|
|
7095
|
+
return Typeson.hasConstructorOf(x, Intl.NumberFormat);
|
|
6994
7096
|
},
|
|
6995
7097
|
replace: function replace(nf) {
|
|
6996
7098
|
return nf.resolvedOptions();
|
|
@@ -7005,10 +7107,10 @@
|
|
|
7005
7107
|
IntlNumberFormat: IntlNumberFormat
|
|
7006
7108
|
};
|
|
7007
7109
|
|
|
7008
|
-
var map
|
|
7110
|
+
var map = {
|
|
7009
7111
|
map: {
|
|
7010
7112
|
test: function test(x) {
|
|
7011
|
-
return
|
|
7113
|
+
return Typeson.toStringTag(x) === 'Map';
|
|
7012
7114
|
},
|
|
7013
7115
|
replace: function replace(mp) {
|
|
7014
7116
|
return _toConsumableArray(mp.entries());
|
|
@@ -7036,13 +7138,13 @@
|
|
|
7036
7138
|
var negativeInfinity = {
|
|
7037
7139
|
negativeInfinity: {
|
|
7038
7140
|
test: function test(x) {
|
|
7039
|
-
return x ===
|
|
7141
|
+
return x === Number.NEGATIVE_INFINITY;
|
|
7040
7142
|
},
|
|
7041
7143
|
replace: function replace(n) {
|
|
7042
7144
|
return '-Infinity';
|
|
7043
7145
|
},
|
|
7044
7146
|
revive: function revive(s) {
|
|
7045
|
-
return
|
|
7147
|
+
return Number.NEGATIVE_INFINITY;
|
|
7046
7148
|
}
|
|
7047
7149
|
}
|
|
7048
7150
|
};
|
|
@@ -7050,10 +7152,10 @@
|
|
|
7050
7152
|
var nonbuiltinIgnore = {
|
|
7051
7153
|
nonbuiltinIgnore: {
|
|
7052
7154
|
test: function test(x) {
|
|
7053
|
-
return x && _typeof(x) === 'object' && !Array.isArray(x) && !['Object', // `Proxy` and `Reflect`, two other built-in objects, will also
|
|
7155
|
+
return x && _typeof$1(x) === 'object' && !Array.isArray(x) && !['Object', // `Proxy` and `Reflect`, two other built-in objects, will also
|
|
7054
7156
|
// have a `toStringTag` of `Object`; we don't want built-in
|
|
7055
7157
|
// function objects, however
|
|
7056
|
-
'Boolean', 'Number', 'String', 'Error', 'RegExp', 'Math', 'Date', 'Map', 'Set', 'JSON', 'ArrayBuffer', 'SharedArrayBuffer', 'DataView', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'Promise', 'String Iterator', 'Array Iterator', 'Map Iterator', 'Set Iterator', 'WeakMap', 'WeakSet', 'Atomics', 'Module'].includes(
|
|
7158
|
+
'Boolean', 'Number', 'String', 'Error', 'RegExp', 'Math', 'Date', 'Map', 'Set', 'JSON', 'ArrayBuffer', 'SharedArrayBuffer', 'DataView', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'Promise', 'String Iterator', 'Array Iterator', 'Map Iterator', 'Set Iterator', 'WeakMap', 'WeakSet', 'Atomics', 'Module'].includes(Typeson.toStringTag(x));
|
|
7057
7159
|
},
|
|
7058
7160
|
replace: function replace(rexp) {// Not in use
|
|
7059
7161
|
}
|
|
@@ -7064,7 +7166,7 @@
|
|
|
7064
7166
|
// String Object (not primitive string which need no type spec)
|
|
7065
7167
|
StringObject: {
|
|
7066
7168
|
test: function test(x) {
|
|
7067
|
-
return
|
|
7169
|
+
return Typeson.toStringTag(x) === 'String' && _typeof$1(x) === 'object';
|
|
7068
7170
|
},
|
|
7069
7171
|
replace: function replace(s) {
|
|
7070
7172
|
return String(s);
|
|
@@ -7078,7 +7180,7 @@
|
|
|
7078
7180
|
// Boolean Object (not primitive boolean which need no type spec)
|
|
7079
7181
|
BooleanObject: {
|
|
7080
7182
|
test: function test(x) {
|
|
7081
|
-
return
|
|
7183
|
+
return Typeson.toStringTag(x) === 'Boolean' && _typeof$1(x) === 'object';
|
|
7082
7184
|
},
|
|
7083
7185
|
replace: function replace(b) {
|
|
7084
7186
|
return Boolean(b);
|
|
@@ -7092,7 +7194,7 @@
|
|
|
7092
7194
|
// Number Object (not primitive number which need no type spec)
|
|
7093
7195
|
NumberObject: {
|
|
7094
7196
|
test: function test(x) {
|
|
7095
|
-
return
|
|
7197
|
+
return Typeson.toStringTag(x) === 'Number' && _typeof$1(x) === 'object';
|
|
7096
7198
|
},
|
|
7097
7199
|
replace: function replace(n) {
|
|
7098
7200
|
return Number(n);
|
|
@@ -7108,7 +7210,7 @@
|
|
|
7108
7210
|
var regexp = {
|
|
7109
7211
|
regexp: {
|
|
7110
7212
|
test: function test(x) {
|
|
7111
|
-
return
|
|
7213
|
+
return Typeson.toStringTag(x) === 'RegExp';
|
|
7112
7214
|
},
|
|
7113
7215
|
replace: function replace(rexp) {
|
|
7114
7216
|
return {
|
|
@@ -7128,7 +7230,7 @@
|
|
|
7128
7230
|
var resurrectable = {
|
|
7129
7231
|
resurrectable: {
|
|
7130
7232
|
test: function test(x) {
|
|
7131
|
-
return x && !Array.isArray(x) && ['object', 'function', 'symbol'].includes(_typeof(x));
|
|
7233
|
+
return x && !Array.isArray(x) && ['object', 'function', 'symbol'].includes(_typeof$1(x));
|
|
7132
7234
|
},
|
|
7133
7235
|
replace: function replace(rsrrctble) {
|
|
7134
7236
|
var uuid = generateUUID();
|
|
@@ -7144,7 +7246,7 @@
|
|
|
7144
7246
|
var set = {
|
|
7145
7247
|
set: {
|
|
7146
7248
|
test: function test(x) {
|
|
7147
|
-
return
|
|
7249
|
+
return Typeson.toStringTag(x) === 'Set';
|
|
7148
7250
|
},
|
|
7149
7251
|
replace: function replace(st) {
|
|
7150
7252
|
return _toConsumableArray(st.values());
|
|
@@ -7157,7 +7259,7 @@
|
|
|
7157
7259
|
|
|
7158
7260
|
/* istanbul ignore next */
|
|
7159
7261
|
|
|
7160
|
-
var _global$1 = typeof self === 'undefined' ? global$
|
|
7262
|
+
var _global$1 = typeof self === 'undefined' ? global$1 : self; // Support all kinds of typed arrays (views of ArrayBuffers)
|
|
7161
7263
|
|
|
7162
7264
|
|
|
7163
7265
|
var typedArraysSocketIO = {};
|
|
@@ -7172,7 +7274,7 @@
|
|
|
7172
7274
|
|
|
7173
7275
|
typedArraysSocketIO[typeName.toLowerCase()] = {
|
|
7174
7276
|
test: function test(x) {
|
|
7175
|
-
return
|
|
7277
|
+
return Typeson.toStringTag(x) === arrType;
|
|
7176
7278
|
},
|
|
7177
7279
|
replace: function replace(a) {
|
|
7178
7280
|
return (a.byteOffset === 0 && a.byteLength === a.buffer.byteLength ? a // socket.io supports streaming ArrayBuffers.
|
|
@@ -7188,19 +7290,19 @@
|
|
|
7188
7290
|
// get here is an ArrayBuffer
|
|
7189
7291
|
// If not, let's assume user wants to receive it as
|
|
7190
7292
|
// configured with socket.io.
|
|
7191
|
-
return
|
|
7293
|
+
return Typeson.toStringTag(buf) === 'ArrayBuffer' ? new TypedArray(buf) : buf;
|
|
7192
7294
|
}
|
|
7193
7295
|
};
|
|
7194
7296
|
});
|
|
7195
7297
|
|
|
7196
7298
|
/* istanbul ignore next */
|
|
7197
7299
|
|
|
7198
|
-
var _global
|
|
7300
|
+
var _global = typeof self === 'undefined' ? global$1 : self;
|
|
7199
7301
|
|
|
7200
7302
|
var typedArrays = {};
|
|
7201
7303
|
['Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array'].forEach(function (typeName) {
|
|
7202
7304
|
var arrType = typeName;
|
|
7203
|
-
var TypedArray = _global
|
|
7305
|
+
var TypedArray = _global[arrType];
|
|
7204
7306
|
/* istanbul ignore if */
|
|
7205
7307
|
|
|
7206
7308
|
if (!TypedArray) {
|
|
@@ -7209,7 +7311,7 @@
|
|
|
7209
7311
|
|
|
7210
7312
|
typedArrays[typeName.toLowerCase()] = {
|
|
7211
7313
|
test: function test(x) {
|
|
7212
|
-
return
|
|
7314
|
+
return Typeson.toStringTag(x) === arrType;
|
|
7213
7315
|
},
|
|
7214
7316
|
replace: function replace(_ref, stateObj) {
|
|
7215
7317
|
var buffer = _ref.buffer,
|
|
@@ -7232,7 +7334,7 @@
|
|
|
7232
7334
|
|
|
7233
7335
|
stateObj.buffers.push(buffer);
|
|
7234
7336
|
return {
|
|
7235
|
-
encoded: encode(buffer),
|
|
7337
|
+
encoded: encode$1(buffer),
|
|
7236
7338
|
byteOffset: byteOffset,
|
|
7237
7339
|
length: l
|
|
7238
7340
|
};
|
|
@@ -7251,7 +7353,7 @@
|
|
|
7251
7353
|
if ('index' in b64Obj) {
|
|
7252
7354
|
buffer = stateObj.buffers[index];
|
|
7253
7355
|
} else {
|
|
7254
|
-
buffer = decode(encoded);
|
|
7356
|
+
buffer = decode$1(encoded);
|
|
7255
7357
|
stateObj.buffers.push(buffer);
|
|
7256
7358
|
}
|
|
7257
7359
|
|
|
@@ -7261,7 +7363,7 @@
|
|
|
7261
7363
|
});
|
|
7262
7364
|
|
|
7263
7365
|
// This does not preserve `undefined` in sparse arrays; see the `undefined`
|
|
7264
|
-
var undef = {
|
|
7366
|
+
var undef$1 = {
|
|
7265
7367
|
undef: {
|
|
7266
7368
|
test: function test(x, stateObj) {
|
|
7267
7369
|
return typeof x === 'undefined' && (stateObj.ownKeys || !('ownKeys' in stateObj));
|
|
@@ -7272,7 +7374,7 @@
|
|
|
7272
7374
|
revive: function revive(s) {
|
|
7273
7375
|
// Will add `undefined` (returning `undefined` would instead
|
|
7274
7376
|
// avoid explicitly setting)
|
|
7275
|
-
return new
|
|
7377
|
+
return new Typeson.Undefined();
|
|
7276
7378
|
}
|
|
7277
7379
|
}
|
|
7278
7380
|
};
|
|
@@ -7280,7 +7382,7 @@
|
|
|
7280
7382
|
var userObject = {
|
|
7281
7383
|
userObject: {
|
|
7282
7384
|
test: function test(x, stateObj) {
|
|
7283
|
-
return
|
|
7385
|
+
return Typeson.isUserObject(x);
|
|
7284
7386
|
},
|
|
7285
7387
|
replace: function replace(n) {
|
|
7286
7388
|
return _objectSpread2({}, n);
|
|
@@ -7373,11 +7475,11 @@
|
|
|
7373
7475
|
|
|
7374
7476
|
Symbols are similarly not included.
|
|
7375
7477
|
*/
|
|
7376
|
-
var expObj = [undef, // ES5
|
|
7478
|
+
var expObj$1 = [undef$1, // ES5
|
|
7377
7479
|
arrayNonindexKeys, primitiveObjects, specialNumbers, date, error, errors, regexp].concat( // ES2015 (ES6)
|
|
7378
7480
|
|
|
7379
7481
|
/* istanbul ignore next */
|
|
7380
|
-
typeof Map === 'function' ? map
|
|
7482
|
+
typeof Map === 'function' ? map : [],
|
|
7381
7483
|
/* istanbul ignore next */
|
|
7382
7484
|
typeof Set === 'function' ? set : [],
|
|
7383
7485
|
/* istanbul ignore next */
|
|
@@ -7408,7 +7510,7 @@
|
|
|
7408
7510
|
*/
|
|
7409
7511
|
var postmessage = [error, errors];
|
|
7410
7512
|
|
|
7411
|
-
var socketio = [expObj, // Leave ArrayBuffer as is, and let socket.io stream it instead.
|
|
7513
|
+
var socketio = [expObj$1, // Leave ArrayBuffer as is, and let socket.io stream it instead.
|
|
7412
7514
|
{
|
|
7413
7515
|
arraybuffer: null
|
|
7414
7516
|
}, // Encapsulate TypedArrays in ArrayBuffers instead of base64 strings.
|
|
@@ -7441,16 +7543,16 @@
|
|
|
7441
7543
|
}];
|
|
7442
7544
|
|
|
7443
7545
|
/* This preset includes types for the Structured Cloning Algorithm. */
|
|
7444
|
-
var expObj
|
|
7546
|
+
var expObj = [// Todo: Might also register synchronous `ImageBitmap` and
|
|
7445
7547
|
// `Blob`/`File`/`FileList`?
|
|
7446
7548
|
// ES5
|
|
7447
7549
|
userObject, // Processed last (non-builtin)
|
|
7448
|
-
undef, arrayNonindexKeys, primitiveObjects, specialNumbers, date, regexp, // Non-built-ins
|
|
7550
|
+
undef$1, arrayNonindexKeys, primitiveObjects, specialNumbers, date, regexp, // Non-built-ins
|
|
7449
7551
|
imagedata, imagebitmap, // Async return
|
|
7450
7552
|
file, filelist, blob].concat( // ES2015 (ES6)
|
|
7451
7553
|
|
|
7452
7554
|
/* istanbul ignore next */
|
|
7453
|
-
typeof Map === 'function' ? map
|
|
7555
|
+
typeof Map === 'function' ? map : [],
|
|
7454
7556
|
/* istanbul ignore next */
|
|
7455
7557
|
typeof Set === 'function' ? set : [],
|
|
7456
7558
|
/* istanbul ignore next */
|
|
@@ -7462,9 +7564,11 @@
|
|
|
7462
7564
|
/* istanbul ignore next */
|
|
7463
7565
|
typeof Intl !== 'undefined' ? intlTypes : [],
|
|
7464
7566
|
/* istanbul ignore next */
|
|
7567
|
+
typeof crypto !== 'undefined' ? cryptokey : [],
|
|
7568
|
+
/* istanbul ignore next */
|
|
7465
7569
|
typeof BigInt !== 'undefined' ? [bigint, bigintObject] : []);
|
|
7466
7570
|
|
|
7467
|
-
var structuredCloningThrowing = expObj
|
|
7571
|
+
var structuredCloningThrowing = expObj.concat({
|
|
7468
7572
|
checkDataCloneException: {
|
|
7469
7573
|
test: function test(val) {
|
|
7470
7574
|
// Should also throw with:
|
|
@@ -7492,7 +7596,7 @@
|
|
|
7492
7596
|
if ([// Symbol's `toStringTag` is only "Symbol" for its initial
|
|
7493
7597
|
// value, so we check `typeof`
|
|
7494
7598
|
'symbol', // All functions including bound function exotic objects
|
|
7495
|
-
'function'].includes(_typeof(val)) || [// A non-array exotic object
|
|
7599
|
+
'function'].includes(_typeof$1(val)) || [// A non-array exotic object
|
|
7496
7600
|
'Arguments', // A non-array exotic object
|
|
7497
7601
|
'Module', // `Error` and other errors have the [[ErrorData]] internal
|
|
7498
7602
|
// slot and give "Error"
|
|
@@ -7510,7 +7614,7 @@
|
|
|
7510
7614
|
((stringTag === 'Blob' || stringTag === 'File') &&
|
|
7511
7615
|
val.isClosed) ||
|
|
7512
7616
|
*/
|
|
7513
|
-
val && _typeof(val) === 'object' && // Duck-type DOM node objects (non-array exotic?
|
|
7617
|
+
val && _typeof$1(val) === 'object' && // Duck-type DOM node objects (non-array exotic?
|
|
7514
7618
|
// objects which cannot be cloned by the SCA)
|
|
7515
7619
|
typeof val.nodeType === 'number' && typeof val.insertBefore === 'function') {
|
|
7516
7620
|
throw new DOMException('The object cannot be cloned.', 'DataCloneError');
|
|
@@ -7521,19 +7625,20 @@
|
|
|
7521
7625
|
}
|
|
7522
7626
|
});
|
|
7523
7627
|
|
|
7524
|
-
var undef
|
|
7628
|
+
var undef = [sparseUndefined, undef$1];
|
|
7525
7629
|
|
|
7526
|
-
var universal = [expObj // TODO: Add types that are de-facto universal even though not
|
|
7630
|
+
var universal = [expObj$1 // TODO: Add types that are de-facto universal even though not
|
|
7527
7631
|
// built-in into ecmasript standard.
|
|
7528
7632
|
];
|
|
7529
7633
|
|
|
7530
7634
|
// This file is auto-generated from `build.js`
|
|
7531
|
-
|
|
7635
|
+
Typeson.types = {
|
|
7532
7636
|
arraybuffer: arraybuffer,
|
|
7533
7637
|
bigintObject: bigintObject,
|
|
7534
7638
|
bigint: bigint,
|
|
7535
7639
|
blob: blob,
|
|
7536
7640
|
cloneable: cloneable,
|
|
7641
|
+
cryptokey: cryptokey,
|
|
7537
7642
|
dataview: dataview,
|
|
7538
7643
|
date: date,
|
|
7539
7644
|
error: error,
|
|
@@ -7544,7 +7649,7 @@
|
|
|
7544
7649
|
imagedata: imagedata,
|
|
7545
7650
|
infinity: infinity,
|
|
7546
7651
|
intlTypes: intlTypes,
|
|
7547
|
-
map: map
|
|
7652
|
+
map: map,
|
|
7548
7653
|
nan: nan,
|
|
7549
7654
|
negativeInfinity: negativeInfinity,
|
|
7550
7655
|
nonbuiltinIgnore: nonbuiltinIgnore,
|
|
@@ -7554,44 +7659,44 @@
|
|
|
7554
7659
|
set: set,
|
|
7555
7660
|
typedArraysSocketio: typedArraysSocketIO,
|
|
7556
7661
|
typedArrays: typedArrays,
|
|
7557
|
-
undef: undef,
|
|
7662
|
+
undef: undef$1,
|
|
7558
7663
|
userObject: userObject
|
|
7559
7664
|
};
|
|
7560
|
-
|
|
7665
|
+
Typeson.presets = {
|
|
7561
7666
|
arrayNonindexKeys: arrayNonindexKeys,
|
|
7562
|
-
builtin: expObj,
|
|
7667
|
+
builtin: expObj$1,
|
|
7563
7668
|
postmessage: postmessage,
|
|
7564
7669
|
socketio: socketio,
|
|
7565
7670
|
sparseUndefined: sparseUndefined,
|
|
7566
7671
|
specialNumbers: specialNumbers,
|
|
7567
7672
|
structuredCloningThrowing: structuredCloningThrowing,
|
|
7568
|
-
structuredCloning: expObj
|
|
7569
|
-
undef: undef
|
|
7673
|
+
structuredCloning: expObj,
|
|
7674
|
+
undef: undef,
|
|
7570
7675
|
universal: universal
|
|
7571
7676
|
};
|
|
7572
7677
|
|
|
7573
|
-
var typeson
|
|
7678
|
+
var typeson = new Typeson().register(Typeson.presets.structuredCloningThrowing);
|
|
7574
7679
|
|
|
7575
7680
|
function register(func) {
|
|
7576
|
-
typeson
|
|
7681
|
+
typeson = new Typeson().register(func(Typeson.presets.structuredCloningThrowing));
|
|
7577
7682
|
} // We are keeping the callback approach for now in case we wish to reexpose
|
|
7578
7683
|
// `Blob`, `File`, `FileList` asynchronously (though in such a case, we
|
|
7579
7684
|
// should probably refactor as a Promise)
|
|
7580
7685
|
|
|
7581
7686
|
|
|
7582
|
-
function encode
|
|
7687
|
+
function encode(obj, func) {
|
|
7583
7688
|
var ret;
|
|
7584
7689
|
|
|
7585
7690
|
try {
|
|
7586
7691
|
// eslint-disable-next-line node/no-sync
|
|
7587
|
-
ret = typeson
|
|
7692
|
+
ret = typeson.stringifySync(obj);
|
|
7588
7693
|
} catch (err) {
|
|
7589
7694
|
// SCA in typeson-registry using `DOMException` which is not defined (e.g., in Node)
|
|
7590
|
-
if (
|
|
7695
|
+
if (Typeson.hasConstructorOf(err, ReferenceError) || // SCA in typeson-registry threw a cloning error and we are in a
|
|
7591
7696
|
// supporting environment (e.g., the browser) where `ShimDOMException` is
|
|
7592
7697
|
// an alias for `DOMException`; if typeson-registry ever uses our shim
|
|
7593
7698
|
// to throw, we can use this condition alone.
|
|
7594
|
-
|
|
7699
|
+
Typeson.hasConstructorOf(err, ShimDOMException)) {
|
|
7595
7700
|
throw createDOMException('DataCloneError', 'The object cannot be cloned.');
|
|
7596
7701
|
} // We should rethrow non-cloning exceptions like from
|
|
7597
7702
|
// throwing getters (as in the W3C test, key-conversion-exceptions.htm)
|
|
@@ -7604,25 +7709,25 @@
|
|
|
7604
7709
|
return ret;
|
|
7605
7710
|
}
|
|
7606
7711
|
|
|
7607
|
-
function decode
|
|
7608
|
-
return typeson
|
|
7712
|
+
function decode(obj) {
|
|
7713
|
+
return typeson.parse(obj);
|
|
7609
7714
|
}
|
|
7610
7715
|
|
|
7611
7716
|
function clone(val) {
|
|
7612
7717
|
// We don't return the intermediate `encode` as we'll need to reencode
|
|
7613
7718
|
// the clone as it may differ
|
|
7614
|
-
return decode
|
|
7719
|
+
return decode(encode(val));
|
|
7615
7720
|
}
|
|
7616
7721
|
|
|
7617
7722
|
var Sca = /*#__PURE__*/Object.freeze({
|
|
7618
7723
|
__proto__: null,
|
|
7619
|
-
encode: encode
|
|
7620
|
-
decode: decode
|
|
7724
|
+
encode: encode,
|
|
7725
|
+
decode: decode,
|
|
7621
7726
|
clone: clone,
|
|
7622
7727
|
register: register
|
|
7623
7728
|
});
|
|
7624
7729
|
|
|
7625
|
-
var readonlyProperties$
|
|
7730
|
+
var readonlyProperties$2 = ['objectStore', 'keyPath', 'multiEntry', 'unique'];
|
|
7626
7731
|
/* eslint-disable jsdoc/check-param-names */
|
|
7627
7732
|
|
|
7628
7733
|
/**
|
|
@@ -7644,7 +7749,7 @@
|
|
|
7644
7749
|
function IDBIndex() {
|
|
7645
7750
|
var me = this;
|
|
7646
7751
|
me[Symbol.toStringTag] = 'IDBIndex';
|
|
7647
|
-
defineReadonlyProperties(me, readonlyProperties$
|
|
7752
|
+
defineReadonlyProperties(me, readonlyProperties$2);
|
|
7648
7753
|
me.__objectStore = store;
|
|
7649
7754
|
me.__name = me.__originalName = indexProperties.columnName;
|
|
7650
7755
|
me.__keyPath = Array.isArray(indexProperties.keyPath) ? indexProperties.keyPath.slice() : indexProperties.keyPath;
|
|
@@ -7793,7 +7898,7 @@
|
|
|
7793
7898
|
function addIndexEntry(i) {
|
|
7794
7899
|
if (i < data.rows.length) {
|
|
7795
7900
|
try {
|
|
7796
|
-
var value = decode
|
|
7901
|
+
var value = decode(unescapeSQLiteResponse(data.rows.item(i).value));
|
|
7797
7902
|
var indexKey = extractKeyValueDecodedFromValueUsingKeyPath(value, index.keyPath, index.multiEntry); // Todo: Do we need this stricter error checking?
|
|
7798
7903
|
|
|
7799
7904
|
if (indexKey.invalid || indexKey.failure) {
|
|
@@ -8002,9 +8107,9 @@
|
|
|
8002
8107
|
*/
|
|
8003
8108
|
|
|
8004
8109
|
|
|
8005
|
-
IDBIndex.prototype.openCursor = function
|
|
8006
|
-
|
|
8007
|
-
{
|
|
8110
|
+
IDBIndex.prototype.openCursor = function
|
|
8111
|
+
/* query, direction */
|
|
8112
|
+
() {
|
|
8008
8113
|
/* eslint-enable jsdoc/check-param-names */
|
|
8009
8114
|
var me = this; // eslint-disable-next-line prefer-rest-params
|
|
8010
8115
|
|
|
@@ -8028,9 +8133,9 @@
|
|
|
8028
8133
|
*/
|
|
8029
8134
|
|
|
8030
8135
|
|
|
8031
|
-
IDBIndex.prototype.openKeyCursor = function
|
|
8032
|
-
|
|
8033
|
-
{
|
|
8136
|
+
IDBIndex.prototype.openKeyCursor = function
|
|
8137
|
+
/* query, direction */
|
|
8138
|
+
() {
|
|
8034
8139
|
/* eslint-enable jsdoc/check-param-names */
|
|
8035
8140
|
var me = this; // eslint-disable-next-line prefer-rest-params
|
|
8036
8141
|
|
|
@@ -8063,9 +8168,9 @@
|
|
|
8063
8168
|
return this.__fetchIndexData(query, 'key', true);
|
|
8064
8169
|
};
|
|
8065
8170
|
|
|
8066
|
-
IDBIndex.prototype.getAll = function
|
|
8067
|
-
|
|
8068
|
-
{
|
|
8171
|
+
IDBIndex.prototype.getAll = function
|
|
8172
|
+
/* query, count */
|
|
8173
|
+
() {
|
|
8069
8174
|
// eslint-disable-next-line prefer-rest-params
|
|
8070
8175
|
var _arguments3 = Array.prototype.slice.call(arguments),
|
|
8071
8176
|
query = _arguments3[0],
|
|
@@ -8074,9 +8179,9 @@
|
|
|
8074
8179
|
return this.__fetchIndexData(query, 'value', false, count);
|
|
8075
8180
|
};
|
|
8076
8181
|
|
|
8077
|
-
IDBIndex.prototype.getAllKeys = function
|
|
8078
|
-
|
|
8079
|
-
{
|
|
8182
|
+
IDBIndex.prototype.getAllKeys = function
|
|
8183
|
+
/* query, count */
|
|
8184
|
+
() {
|
|
8080
8185
|
// eslint-disable-next-line prefer-rest-params
|
|
8081
8186
|
var _arguments4 = Array.prototype.slice.call(arguments),
|
|
8082
8187
|
query = _arguments4[0],
|
|
@@ -8085,9 +8190,9 @@
|
|
|
8085
8190
|
return this.__fetchIndexData(query, 'key', false, count);
|
|
8086
8191
|
};
|
|
8087
8192
|
|
|
8088
|
-
IDBIndex.prototype.count = function
|
|
8089
|
-
|
|
8090
|
-
{
|
|
8193
|
+
IDBIndex.prototype.count = function
|
|
8194
|
+
/* query */
|
|
8195
|
+
() {
|
|
8091
8196
|
var me = this; // eslint-disable-next-line prefer-rest-params
|
|
8092
8197
|
|
|
8093
8198
|
var query = arguments[0]; // With the exception of needing to check whether the index has been
|
|
@@ -8203,7 +8308,7 @@
|
|
|
8203
8308
|
return isObj(obj) && typeof obj.openCursor === 'function' && typeof obj.multiEntry === 'boolean';
|
|
8204
8309
|
}
|
|
8205
8310
|
});
|
|
8206
|
-
defineReadonlyOuterInterface(IDBIndex.prototype, readonlyProperties$
|
|
8311
|
+
defineReadonlyOuterInterface(IDBIndex.prototype, readonlyProperties$2);
|
|
8207
8312
|
defineOuterInterface(IDBIndex.prototype, ['name']);
|
|
8208
8313
|
IDBIndex.prototype[Symbol.toStringTag] = 'IDBIndexPrototype';
|
|
8209
8314
|
Object.defineProperty(IDBIndex, 'prototype', {
|
|
@@ -8224,14 +8329,14 @@
|
|
|
8224
8329
|
tx.executeSql(sql.join(' '), sqlValues, function (tx, data) {
|
|
8225
8330
|
var records = [];
|
|
8226
8331
|
var recordCount = 0;
|
|
8227
|
-
var decode = isCount ? function () {
|
|
8332
|
+
var decode$1 = isCount ? function () {
|
|
8228
8333
|
/* */
|
|
8229
8334
|
} : opType === 'key' ? function (record) {
|
|
8230
8335
|
// Key.convertValueToKey(record.key); // Already validated before storage
|
|
8231
8336
|
return _decode(unescapeSQLiteResponse(record.key));
|
|
8232
8337
|
} : function (record) {
|
|
8233
8338
|
// when opType is value
|
|
8234
|
-
return decode
|
|
8339
|
+
return decode(unescapeSQLiteResponse(record.value));
|
|
8235
8340
|
};
|
|
8236
8341
|
|
|
8237
8342
|
if (index.multiEntry) {
|
|
@@ -8257,7 +8362,7 @@
|
|
|
8257
8362
|
}
|
|
8258
8363
|
|
|
8259
8364
|
if (record) {
|
|
8260
|
-
records.push(decode(record));
|
|
8365
|
+
records.push(decode$1(record));
|
|
8261
8366
|
|
|
8262
8367
|
if (unboundedDisallowed) {
|
|
8263
8368
|
return "break";
|
|
@@ -8275,7 +8380,7 @@
|
|
|
8275
8380
|
var record = data.rows.item(_i);
|
|
8276
8381
|
|
|
8277
8382
|
if (record) {
|
|
8278
|
-
records.push(decode(record));
|
|
8383
|
+
records.push(decode$1(record));
|
|
8279
8384
|
}
|
|
8280
8385
|
}
|
|
8281
8386
|
|
|
@@ -8320,7 +8425,7 @@
|
|
|
8320
8425
|
return [nullDisallowed, index, hasRange, range, opType, multiChecks, sql, sqlValues];
|
|
8321
8426
|
}
|
|
8322
8427
|
|
|
8323
|
-
var readonlyProperties$
|
|
8428
|
+
var readonlyProperties$1 = ['keyPath', 'indexNames', 'transaction', 'autoIncrement'];
|
|
8324
8429
|
/* eslint-disable jsdoc/check-param-names */
|
|
8325
8430
|
|
|
8326
8431
|
/**
|
|
@@ -8342,7 +8447,7 @@
|
|
|
8342
8447
|
function IDBObjectStore() {
|
|
8343
8448
|
var me = this;
|
|
8344
8449
|
me[Symbol.toStringTag] = 'IDBObjectStore';
|
|
8345
|
-
defineReadonlyProperties(this, readonlyProperties$
|
|
8450
|
+
defineReadonlyProperties(this, readonlyProperties$1);
|
|
8346
8451
|
me.__name = me.__originalName = storeProperties.name;
|
|
8347
8452
|
me.__keyPath = Array.isArray(storeProperties.keyPath) ? storeProperties.keyPath.slice() : storeProperties.keyPath;
|
|
8348
8453
|
me.__transaction = transaction;
|
|
@@ -8676,8 +8781,8 @@
|
|
|
8676
8781
|
|
|
8677
8782
|
function keyCloneThenSuccess(oldCn) {
|
|
8678
8783
|
// We want to return the original key, so we don't need to accept an argument here
|
|
8679
|
-
encode
|
|
8680
|
-
key = decode
|
|
8784
|
+
encode(key, function (key) {
|
|
8785
|
+
key = decode(key);
|
|
8681
8786
|
success(key, oldCn);
|
|
8682
8787
|
});
|
|
8683
8788
|
}
|
|
@@ -8816,7 +8921,8 @@
|
|
|
8816
8921
|
return undefined;
|
|
8817
8922
|
})["catch"](function (err) {
|
|
8818
8923
|
function fail() {
|
|
8819
|
-
// Todo: Add a different error object here if `assignCurrentNumber`
|
|
8924
|
+
// Todo: Add a different error object here if `assignCurrentNumber`
|
|
8925
|
+
// fails in reverting?
|
|
8820
8926
|
error(err);
|
|
8821
8927
|
}
|
|
8822
8928
|
|
|
@@ -8917,7 +9023,7 @@
|
|
|
8917
9023
|
|
|
8918
9024
|
store.transaction.__pushToQueue(request, function (tx, args, success, error) {
|
|
8919
9025
|
store.__deriveKey(tx, value, key, function (clonedKeyOrCurrentNumber, oldCn) {
|
|
8920
|
-
encode
|
|
9026
|
+
encode(value, function (encoded) {
|
|
8921
9027
|
function insert(tx) {
|
|
8922
9028
|
store.__insertData(tx, encoded, value, clonedKeyOrCurrentNumber, oldCn, function () {
|
|
8923
9029
|
if (invalidateCache) {
|
|
@@ -9003,7 +9109,7 @@
|
|
|
9003
9109
|
}
|
|
9004
9110
|
} else {
|
|
9005
9111
|
for (var _i = 0; _i < data.rows.length; _i++) {
|
|
9006
|
-
ret.push(decode
|
|
9112
|
+
ret.push(decode(unescapeSQLiteResponse(data.rows.item(_i).value)));
|
|
9007
9113
|
}
|
|
9008
9114
|
}
|
|
9009
9115
|
|
|
@@ -9038,9 +9144,9 @@
|
|
|
9038
9144
|
return this.__get(query, true);
|
|
9039
9145
|
};
|
|
9040
9146
|
|
|
9041
|
-
IDBObjectStore.prototype.getAll = function
|
|
9042
|
-
|
|
9043
|
-
{
|
|
9147
|
+
IDBObjectStore.prototype.getAll = function
|
|
9148
|
+
/* query, count */
|
|
9149
|
+
() {
|
|
9044
9150
|
// eslint-disable-next-line prefer-rest-params
|
|
9045
9151
|
var _arguments = Array.prototype.slice.call(arguments),
|
|
9046
9152
|
query = _arguments[0],
|
|
@@ -9049,9 +9155,9 @@
|
|
|
9049
9155
|
return this.__get(query, false, true, count);
|
|
9050
9156
|
};
|
|
9051
9157
|
|
|
9052
|
-
IDBObjectStore.prototype.getAllKeys = function
|
|
9053
|
-
|
|
9054
|
-
{
|
|
9158
|
+
IDBObjectStore.prototype.getAllKeys = function
|
|
9159
|
+
/* query, count */
|
|
9160
|
+
() {
|
|
9055
9161
|
// eslint-disable-next-line prefer-rest-params
|
|
9056
9162
|
var _arguments2 = Array.prototype.slice.call(arguments),
|
|
9057
9163
|
query = _arguments2[0],
|
|
@@ -9128,9 +9234,9 @@
|
|
|
9128
9234
|
}, undefined, me);
|
|
9129
9235
|
};
|
|
9130
9236
|
|
|
9131
|
-
IDBObjectStore.prototype.count = function
|
|
9132
|
-
|
|
9133
|
-
{
|
|
9237
|
+
IDBObjectStore.prototype.count = function
|
|
9238
|
+
/* query */
|
|
9239
|
+
() {
|
|
9134
9240
|
var me = this; // eslint-disable-next-line prefer-rest-params
|
|
9135
9241
|
|
|
9136
9242
|
var query = arguments[0];
|
|
@@ -9147,9 +9253,9 @@
|
|
|
9147
9253
|
return IDBCursorWithValue.__createInstance(query, 'next', me, me, 'key', 'value', true).__request;
|
|
9148
9254
|
};
|
|
9149
9255
|
|
|
9150
|
-
IDBObjectStore.prototype.openCursor = function
|
|
9151
|
-
|
|
9152
|
-
{
|
|
9256
|
+
IDBObjectStore.prototype.openCursor = function
|
|
9257
|
+
/* query, direction */
|
|
9258
|
+
() {
|
|
9153
9259
|
var me = this; // eslint-disable-next-line prefer-rest-params
|
|
9154
9260
|
|
|
9155
9261
|
var _arguments3 = Array.prototype.slice.call(arguments),
|
|
@@ -9169,9 +9275,9 @@
|
|
|
9169
9275
|
return cursor.__request;
|
|
9170
9276
|
};
|
|
9171
9277
|
|
|
9172
|
-
IDBObjectStore.prototype.openKeyCursor = function
|
|
9173
|
-
|
|
9174
|
-
{
|
|
9278
|
+
IDBObjectStore.prototype.openKeyCursor = function
|
|
9279
|
+
/* query, direction */
|
|
9280
|
+
() {
|
|
9175
9281
|
var me = this;
|
|
9176
9282
|
|
|
9177
9283
|
if (!(me instanceof IDBObjectStore)) {
|
|
@@ -9273,7 +9379,7 @@
|
|
|
9273
9379
|
}
|
|
9274
9380
|
|
|
9275
9381
|
optionalParameters = optionalParameters || {};
|
|
9276
|
-
/** @name IDBIndexProperties
|
|
9382
|
+
/** @name IDBIndexProperties */
|
|
9277
9383
|
|
|
9278
9384
|
var indexProperties = {
|
|
9279
9385
|
columnName: indexName,
|
|
@@ -9317,7 +9423,7 @@
|
|
|
9317
9423
|
IDBIndex.__deleteIndex(me, index);
|
|
9318
9424
|
};
|
|
9319
9425
|
|
|
9320
|
-
defineReadonlyOuterInterface(IDBObjectStore.prototype, readonlyProperties$
|
|
9426
|
+
defineReadonlyOuterInterface(IDBObjectStore.prototype, readonlyProperties$1);
|
|
9321
9427
|
defineOuterInterface(IDBObjectStore.prototype, ['name']);
|
|
9322
9428
|
IDBObjectStore.prototype[Symbol.toStringTag] = 'IDBObjectStorePrototype';
|
|
9323
9429
|
Object.defineProperty(IDBObjectStore, 'prototype', {
|
|
@@ -9553,8 +9659,8 @@
|
|
|
9553
9659
|
return str.substr(start, len);
|
|
9554
9660
|
};
|
|
9555
9661
|
|
|
9556
|
-
var listeners
|
|
9557
|
-
var readonlyProperties
|
|
9662
|
+
var listeners = ['onabort', 'onclose', 'onerror', 'onversionchange'];
|
|
9663
|
+
var readonlyProperties = ['name', 'version', 'objectStoreNames'];
|
|
9558
9664
|
/**
|
|
9559
9665
|
* IDB Database Object.
|
|
9560
9666
|
* @see http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#database-interface
|
|
@@ -9572,14 +9678,14 @@
|
|
|
9572
9678
|
var _this = this;
|
|
9573
9679
|
|
|
9574
9680
|
this[Symbol.toStringTag] = 'IDBDatabase';
|
|
9575
|
-
defineReadonlyProperties(this, readonlyProperties
|
|
9681
|
+
defineReadonlyProperties(this, readonlyProperties);
|
|
9576
9682
|
this.__db = db;
|
|
9577
9683
|
this.__closePending = false;
|
|
9578
9684
|
this.__oldVersion = oldVersion;
|
|
9579
9685
|
this.__version = version;
|
|
9580
9686
|
this.__name = name;
|
|
9581
9687
|
this.__upgradeTransaction = null;
|
|
9582
|
-
defineListenerProperties(this, listeners
|
|
9688
|
+
defineListenerProperties(this, listeners);
|
|
9583
9689
|
|
|
9584
9690
|
this.__setOptions({
|
|
9585
9691
|
legacyOutputDidListenersThrowFlag: true // Event hook for IndexedB
|
|
@@ -9678,7 +9784,7 @@
|
|
|
9678
9784
|
if (autoInc && (keyPath === '' || Array.isArray(keyPath))) {
|
|
9679
9785
|
throw createDOMException('InvalidAccessError', 'With autoIncrement set, the keyPath argument must not be an array or empty string.');
|
|
9680
9786
|
}
|
|
9681
|
-
/** @name IDBObjectStoreProperties
|
|
9787
|
+
/** @name IDBObjectStoreProperties */
|
|
9682
9788
|
|
|
9683
9789
|
|
|
9684
9790
|
var storeProperties = {
|
|
@@ -9846,8 +9952,8 @@
|
|
|
9846
9952
|
});
|
|
9847
9953
|
};
|
|
9848
9954
|
|
|
9849
|
-
defineOuterInterface(IDBDatabase.prototype, listeners
|
|
9850
|
-
defineReadonlyOuterInterface(IDBDatabase.prototype, readonlyProperties
|
|
9955
|
+
defineOuterInterface(IDBDatabase.prototype, listeners);
|
|
9956
|
+
defineReadonlyOuterInterface(IDBDatabase.prototype, readonlyProperties);
|
|
9851
9957
|
Object.defineProperty(IDBDatabase.prototype, 'constructor', {
|
|
9852
9958
|
enumerable: false,
|
|
9853
9959
|
writable: true,
|
|
@@ -9865,7 +9971,7 @@
|
|
|
9865
9971
|
};
|
|
9866
9972
|
|
|
9867
9973
|
var getOrigin = function getOrigin() {
|
|
9868
|
-
return (typeof location === "undefined" ? "undefined" : _typeof(location)) !== 'object' || !location ? 'null' : location.origin;
|
|
9974
|
+
return (typeof location === "undefined" ? "undefined" : _typeof$1(location)) !== 'object' || !location ? 'null' : location.origin;
|
|
9869
9975
|
};
|
|
9870
9976
|
|
|
9871
9977
|
var hasNullOrigin = function hasNullOrigin() {
|
|
@@ -10827,9 +10933,7 @@
|
|
|
10827
10933
|
return _construct(IDBCursor, args);
|
|
10828
10934
|
};
|
|
10829
10935
|
|
|
10830
|
-
IDBCursor.prototype.__find = function ()
|
|
10831
|
-
/* key, tx, success, error, recordsToLoad */
|
|
10832
|
-
{
|
|
10936
|
+
IDBCursor.prototype.__find = function () {
|
|
10833
10937
|
if (this.__multiEntryIndex) {
|
|
10834
10938
|
this.__findMultiEntry.apply(this, arguments);
|
|
10835
10939
|
} else {
|
|
@@ -11241,9 +11345,9 @@
|
|
|
11241
11345
|
});
|
|
11242
11346
|
};
|
|
11243
11347
|
|
|
11244
|
-
IDBCursor.prototype["continue"] = function
|
|
11245
|
-
|
|
11246
|
-
{
|
|
11348
|
+
IDBCursor.prototype["continue"] = function
|
|
11349
|
+
/* key */
|
|
11350
|
+
() {
|
|
11247
11351
|
// eslint-disable-next-line prefer-rest-params
|
|
11248
11352
|
this.__continue(arguments[0]);
|
|
11249
11353
|
};
|
|
@@ -11280,8 +11384,8 @@
|
|
|
11280
11384
|
}
|
|
11281
11385
|
|
|
11282
11386
|
if (cmpResult === 0) {
|
|
11283
|
-
encode
|
|
11284
|
-
encode
|
|
11387
|
+
encode(primaryKey, function (encPrimaryKey) {
|
|
11388
|
+
encode(me.primaryKey, function (encObjectStorePos) {
|
|
11285
11389
|
if (encPrimaryKey === encObjectStorePos || me.direction === 'next' && encPrimaryKey < encObjectStorePos || me.direction === 'prev' && encPrimaryKey > encObjectStorePos) {
|
|
11286
11390
|
throw createDOMException('DataError', 'Cannot continue the cursor in an unexpected direction');
|
|
11287
11391
|
}
|
|
@@ -11438,7 +11542,7 @@
|
|
|
11438
11542
|
});
|
|
11439
11543
|
|
|
11440
11544
|
function setConfig(prop, val) {
|
|
11441
|
-
if (prop && _typeof(prop) === 'object') {
|
|
11545
|
+
if (prop && _typeof$1(prop) === 'object') {
|
|
11442
11546
|
Object.entries(prop).forEach(function (_ref) {
|
|
11443
11547
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
11444
11548
|
p = _ref2[0],
|
|
@@ -11465,7 +11569,7 @@
|
|
|
11465
11569
|
setConfig(initialConfig);
|
|
11466
11570
|
}
|
|
11467
11571
|
|
|
11468
|
-
var IDB = idb || (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : typeof global$
|
|
11572
|
+
var IDB = idb || (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : typeof global$1 !== 'undefined' ? global$1 : {});
|
|
11469
11573
|
|
|
11470
11574
|
function shim(name, value, propDesc) {
|
|
11471
11575
|
if (!propDesc || !Object.defineProperty) {
|
|
@@ -11522,7 +11626,7 @@
|
|
|
11522
11626
|
IDB.shimIndexedDB.__useShim = function () {
|
|
11523
11627
|
function setNonIDBGlobals() {
|
|
11524
11628
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11525
|
-
shim(prefix + 'DOMException', ShimDOMException
|
|
11629
|
+
shim(prefix + 'DOMException', ShimDOMException);
|
|
11526
11630
|
shim(prefix + 'DOMStringList', DOMStringList, {
|
|
11527
11631
|
enumerable: false,
|
|
11528
11632
|
configurable: true,
|
|
@@ -11590,8 +11694,8 @@
|
|
|
11590
11694
|
Object.setPrototypeOf(IDBRequest, EventTarget);
|
|
11591
11695
|
Object.setPrototypeOf(IDBTransaction, EventTarget);
|
|
11592
11696
|
Object.setPrototypeOf(IDBVersionChangeEvent, ShimEvent);
|
|
11593
|
-
Object.setPrototypeOf(ShimDOMException
|
|
11594
|
-
Object.setPrototypeOf(ShimDOMException
|
|
11697
|
+
Object.setPrototypeOf(ShimDOMException, Error);
|
|
11698
|
+
Object.setPrototypeOf(ShimDOMException.prototype, Error.prototype);
|
|
11595
11699
|
setPrototypeOfCustomEvent();
|
|
11596
11700
|
}
|
|
11597
11701
|
|
|
@@ -11696,5 +11800,5 @@
|
|
|
11696
11800
|
|
|
11697
11801
|
return setGlobalVars;
|
|
11698
11802
|
|
|
11699
|
-
}))
|
|
11803
|
+
}));
|
|
11700
11804
|
//# sourceMappingURL=indexeddbshim-noninvasive.js.map
|