@signetai/connector-base 0.154.0 → 0.154.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +123 -91
- package/dist/lenient-json.d.ts +5 -0
- package/dist/lenient-json.d.ts.map +1 -0
- package/dist/lenient-json.js +2014 -0
- package/package.json +9 -3
|
@@ -0,0 +1,2014 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toESMCache_node;
|
|
10
|
+
var __toESMCache_esm;
|
|
11
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
12
|
+
var canCache = mod != null && typeof mod === "object";
|
|
13
|
+
if (canCache) {
|
|
14
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
15
|
+
var cached = cache.get(mod);
|
|
16
|
+
if (cached)
|
|
17
|
+
return cached;
|
|
18
|
+
}
|
|
19
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
20
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
for (let key of __getOwnPropNames(mod))
|
|
22
|
+
if (!__hasOwnProp.call(to, key))
|
|
23
|
+
__defProp(to, key, {
|
|
24
|
+
get: __accessProp.bind(mod, key),
|
|
25
|
+
enumerable: true
|
|
26
|
+
});
|
|
27
|
+
if (canCache)
|
|
28
|
+
cache.set(mod, to);
|
|
29
|
+
return to;
|
|
30
|
+
};
|
|
31
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/.bun/json5@2.2.3/node_modules/json5/lib/unicode.js
|
|
34
|
+
var require_unicode = __commonJS((exports, module) => {
|
|
35
|
+
exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
36
|
+
exports.ID_Start = /[\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\u0860-\u086A\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\u09FC\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-\u1884\u1887-\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
37
|
+
exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\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\u0860-\u086A\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\u09FC\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-\u0AFF\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\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\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\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-\u19D9\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-\u1CF9\u1D00-\u1DF9\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// ../../node_modules/.bun/json5@2.2.3/node_modules/json5/lib/util.js
|
|
41
|
+
var require_util = __commonJS((exports, module) => {
|
|
42
|
+
var unicode = require_unicode();
|
|
43
|
+
module.exports = {
|
|
44
|
+
isSpaceSeparator(c) {
|
|
45
|
+
return typeof c === "string" && unicode.Space_Separator.test(c);
|
|
46
|
+
},
|
|
47
|
+
isIdStartChar(c) {
|
|
48
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
49
|
+
},
|
|
50
|
+
isIdContinueChar(c) {
|
|
51
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "" || c === "" || unicode.ID_Continue.test(c));
|
|
52
|
+
},
|
|
53
|
+
isDigit(c) {
|
|
54
|
+
return typeof c === "string" && /[0-9]/.test(c);
|
|
55
|
+
},
|
|
56
|
+
isHexDigit(c) {
|
|
57
|
+
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// ../../node_modules/.bun/json5@2.2.3/node_modules/json5/lib/parse.js
|
|
63
|
+
var require_parse = __commonJS((exports, module) => {
|
|
64
|
+
var util = require_util();
|
|
65
|
+
var source;
|
|
66
|
+
var parseState;
|
|
67
|
+
var stack;
|
|
68
|
+
var pos;
|
|
69
|
+
var line;
|
|
70
|
+
var column;
|
|
71
|
+
var token;
|
|
72
|
+
var key;
|
|
73
|
+
var root;
|
|
74
|
+
module.exports = function parse(text, reviver) {
|
|
75
|
+
source = String(text);
|
|
76
|
+
parseState = "start";
|
|
77
|
+
stack = [];
|
|
78
|
+
pos = 0;
|
|
79
|
+
line = 1;
|
|
80
|
+
column = 0;
|
|
81
|
+
token = undefined;
|
|
82
|
+
key = undefined;
|
|
83
|
+
root = undefined;
|
|
84
|
+
do {
|
|
85
|
+
token = lex();
|
|
86
|
+
parseStates[parseState]();
|
|
87
|
+
} while (token.type !== "eof");
|
|
88
|
+
if (typeof reviver === "function") {
|
|
89
|
+
return internalize({ "": root }, "", reviver);
|
|
90
|
+
}
|
|
91
|
+
return root;
|
|
92
|
+
};
|
|
93
|
+
function internalize(holder, name, reviver) {
|
|
94
|
+
const value = holder[name];
|
|
95
|
+
if (value != null && typeof value === "object") {
|
|
96
|
+
if (Array.isArray(value)) {
|
|
97
|
+
for (let i = 0;i < value.length; i++) {
|
|
98
|
+
const key2 = String(i);
|
|
99
|
+
const replacement = internalize(value, key2, reviver);
|
|
100
|
+
if (replacement === undefined) {
|
|
101
|
+
delete value[key2];
|
|
102
|
+
} else {
|
|
103
|
+
Object.defineProperty(value, key2, {
|
|
104
|
+
value: replacement,
|
|
105
|
+
writable: true,
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
for (const key2 in value) {
|
|
113
|
+
const replacement = internalize(value, key2, reviver);
|
|
114
|
+
if (replacement === undefined) {
|
|
115
|
+
delete value[key2];
|
|
116
|
+
} else {
|
|
117
|
+
Object.defineProperty(value, key2, {
|
|
118
|
+
value: replacement,
|
|
119
|
+
writable: true,
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return reviver.call(holder, name, value);
|
|
128
|
+
}
|
|
129
|
+
var lexState;
|
|
130
|
+
var buffer;
|
|
131
|
+
var doubleQuote;
|
|
132
|
+
var sign;
|
|
133
|
+
var c;
|
|
134
|
+
function lex() {
|
|
135
|
+
lexState = "default";
|
|
136
|
+
buffer = "";
|
|
137
|
+
doubleQuote = false;
|
|
138
|
+
sign = 1;
|
|
139
|
+
for (;; ) {
|
|
140
|
+
c = peek();
|
|
141
|
+
const token2 = lexStates[lexState]();
|
|
142
|
+
if (token2) {
|
|
143
|
+
return token2;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function peek() {
|
|
148
|
+
if (source[pos]) {
|
|
149
|
+
return String.fromCodePoint(source.codePointAt(pos));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function read() {
|
|
153
|
+
const c2 = peek();
|
|
154
|
+
if (c2 === `
|
|
155
|
+
`) {
|
|
156
|
+
line++;
|
|
157
|
+
column = 0;
|
|
158
|
+
} else if (c2) {
|
|
159
|
+
column += c2.length;
|
|
160
|
+
} else {
|
|
161
|
+
column++;
|
|
162
|
+
}
|
|
163
|
+
if (c2) {
|
|
164
|
+
pos += c2.length;
|
|
165
|
+
}
|
|
166
|
+
return c2;
|
|
167
|
+
}
|
|
168
|
+
var lexStates = {
|
|
169
|
+
default() {
|
|
170
|
+
switch (c) {
|
|
171
|
+
case "\t":
|
|
172
|
+
case "\v":
|
|
173
|
+
case "\f":
|
|
174
|
+
case " ":
|
|
175
|
+
case " ":
|
|
176
|
+
case "\uFEFF":
|
|
177
|
+
case `
|
|
178
|
+
`:
|
|
179
|
+
case "\r":
|
|
180
|
+
case "\u2028":
|
|
181
|
+
case "\u2029":
|
|
182
|
+
read();
|
|
183
|
+
return;
|
|
184
|
+
case "/":
|
|
185
|
+
read();
|
|
186
|
+
lexState = "comment";
|
|
187
|
+
return;
|
|
188
|
+
case undefined:
|
|
189
|
+
read();
|
|
190
|
+
return newToken("eof");
|
|
191
|
+
}
|
|
192
|
+
if (util.isSpaceSeparator(c)) {
|
|
193
|
+
read();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
return lexStates[parseState]();
|
|
197
|
+
},
|
|
198
|
+
comment() {
|
|
199
|
+
switch (c) {
|
|
200
|
+
case "*":
|
|
201
|
+
read();
|
|
202
|
+
lexState = "multiLineComment";
|
|
203
|
+
return;
|
|
204
|
+
case "/":
|
|
205
|
+
read();
|
|
206
|
+
lexState = "singleLineComment";
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
throw invalidChar(read());
|
|
210
|
+
},
|
|
211
|
+
multiLineComment() {
|
|
212
|
+
switch (c) {
|
|
213
|
+
case "*":
|
|
214
|
+
read();
|
|
215
|
+
lexState = "multiLineCommentAsterisk";
|
|
216
|
+
return;
|
|
217
|
+
case undefined:
|
|
218
|
+
throw invalidChar(read());
|
|
219
|
+
}
|
|
220
|
+
read();
|
|
221
|
+
},
|
|
222
|
+
multiLineCommentAsterisk() {
|
|
223
|
+
switch (c) {
|
|
224
|
+
case "*":
|
|
225
|
+
read();
|
|
226
|
+
return;
|
|
227
|
+
case "/":
|
|
228
|
+
read();
|
|
229
|
+
lexState = "default";
|
|
230
|
+
return;
|
|
231
|
+
case undefined:
|
|
232
|
+
throw invalidChar(read());
|
|
233
|
+
}
|
|
234
|
+
read();
|
|
235
|
+
lexState = "multiLineComment";
|
|
236
|
+
},
|
|
237
|
+
singleLineComment() {
|
|
238
|
+
switch (c) {
|
|
239
|
+
case `
|
|
240
|
+
`:
|
|
241
|
+
case "\r":
|
|
242
|
+
case "\u2028":
|
|
243
|
+
case "\u2029":
|
|
244
|
+
read();
|
|
245
|
+
lexState = "default";
|
|
246
|
+
return;
|
|
247
|
+
case undefined:
|
|
248
|
+
read();
|
|
249
|
+
return newToken("eof");
|
|
250
|
+
}
|
|
251
|
+
read();
|
|
252
|
+
},
|
|
253
|
+
value() {
|
|
254
|
+
switch (c) {
|
|
255
|
+
case "{":
|
|
256
|
+
case "[":
|
|
257
|
+
return newToken("punctuator", read());
|
|
258
|
+
case "n":
|
|
259
|
+
read();
|
|
260
|
+
literal("ull");
|
|
261
|
+
return newToken("null", null);
|
|
262
|
+
case "t":
|
|
263
|
+
read();
|
|
264
|
+
literal("rue");
|
|
265
|
+
return newToken("boolean", true);
|
|
266
|
+
case "f":
|
|
267
|
+
read();
|
|
268
|
+
literal("alse");
|
|
269
|
+
return newToken("boolean", false);
|
|
270
|
+
case "-":
|
|
271
|
+
case "+":
|
|
272
|
+
if (read() === "-") {
|
|
273
|
+
sign = -1;
|
|
274
|
+
}
|
|
275
|
+
lexState = "sign";
|
|
276
|
+
return;
|
|
277
|
+
case ".":
|
|
278
|
+
buffer = read();
|
|
279
|
+
lexState = "decimalPointLeading";
|
|
280
|
+
return;
|
|
281
|
+
case "0":
|
|
282
|
+
buffer = read();
|
|
283
|
+
lexState = "zero";
|
|
284
|
+
return;
|
|
285
|
+
case "1":
|
|
286
|
+
case "2":
|
|
287
|
+
case "3":
|
|
288
|
+
case "4":
|
|
289
|
+
case "5":
|
|
290
|
+
case "6":
|
|
291
|
+
case "7":
|
|
292
|
+
case "8":
|
|
293
|
+
case "9":
|
|
294
|
+
buffer = read();
|
|
295
|
+
lexState = "decimalInteger";
|
|
296
|
+
return;
|
|
297
|
+
case "I":
|
|
298
|
+
read();
|
|
299
|
+
literal("nfinity");
|
|
300
|
+
return newToken("numeric", Infinity);
|
|
301
|
+
case "N":
|
|
302
|
+
read();
|
|
303
|
+
literal("aN");
|
|
304
|
+
return newToken("numeric", NaN);
|
|
305
|
+
case '"':
|
|
306
|
+
case "'":
|
|
307
|
+
doubleQuote = read() === '"';
|
|
308
|
+
buffer = "";
|
|
309
|
+
lexState = "string";
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
throw invalidChar(read());
|
|
313
|
+
},
|
|
314
|
+
identifierNameStartEscape() {
|
|
315
|
+
if (c !== "u") {
|
|
316
|
+
throw invalidChar(read());
|
|
317
|
+
}
|
|
318
|
+
read();
|
|
319
|
+
const u = unicodeEscape();
|
|
320
|
+
switch (u) {
|
|
321
|
+
case "$":
|
|
322
|
+
case "_":
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
if (!util.isIdStartChar(u)) {
|
|
326
|
+
throw invalidIdentifier();
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
buffer += u;
|
|
331
|
+
lexState = "identifierName";
|
|
332
|
+
},
|
|
333
|
+
identifierName() {
|
|
334
|
+
switch (c) {
|
|
335
|
+
case "$":
|
|
336
|
+
case "_":
|
|
337
|
+
case "":
|
|
338
|
+
case "":
|
|
339
|
+
buffer += read();
|
|
340
|
+
return;
|
|
341
|
+
case "\\":
|
|
342
|
+
read();
|
|
343
|
+
lexState = "identifierNameEscape";
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (util.isIdContinueChar(c)) {
|
|
347
|
+
buffer += read();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
return newToken("identifier", buffer);
|
|
351
|
+
},
|
|
352
|
+
identifierNameEscape() {
|
|
353
|
+
if (c !== "u") {
|
|
354
|
+
throw invalidChar(read());
|
|
355
|
+
}
|
|
356
|
+
read();
|
|
357
|
+
const u = unicodeEscape();
|
|
358
|
+
switch (u) {
|
|
359
|
+
case "$":
|
|
360
|
+
case "_":
|
|
361
|
+
case "":
|
|
362
|
+
case "":
|
|
363
|
+
break;
|
|
364
|
+
default:
|
|
365
|
+
if (!util.isIdContinueChar(u)) {
|
|
366
|
+
throw invalidIdentifier();
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
buffer += u;
|
|
371
|
+
lexState = "identifierName";
|
|
372
|
+
},
|
|
373
|
+
sign() {
|
|
374
|
+
switch (c) {
|
|
375
|
+
case ".":
|
|
376
|
+
buffer = read();
|
|
377
|
+
lexState = "decimalPointLeading";
|
|
378
|
+
return;
|
|
379
|
+
case "0":
|
|
380
|
+
buffer = read();
|
|
381
|
+
lexState = "zero";
|
|
382
|
+
return;
|
|
383
|
+
case "1":
|
|
384
|
+
case "2":
|
|
385
|
+
case "3":
|
|
386
|
+
case "4":
|
|
387
|
+
case "5":
|
|
388
|
+
case "6":
|
|
389
|
+
case "7":
|
|
390
|
+
case "8":
|
|
391
|
+
case "9":
|
|
392
|
+
buffer = read();
|
|
393
|
+
lexState = "decimalInteger";
|
|
394
|
+
return;
|
|
395
|
+
case "I":
|
|
396
|
+
read();
|
|
397
|
+
literal("nfinity");
|
|
398
|
+
return newToken("numeric", sign * Infinity);
|
|
399
|
+
case "N":
|
|
400
|
+
read();
|
|
401
|
+
literal("aN");
|
|
402
|
+
return newToken("numeric", NaN);
|
|
403
|
+
}
|
|
404
|
+
throw invalidChar(read());
|
|
405
|
+
},
|
|
406
|
+
zero() {
|
|
407
|
+
switch (c) {
|
|
408
|
+
case ".":
|
|
409
|
+
buffer += read();
|
|
410
|
+
lexState = "decimalPoint";
|
|
411
|
+
return;
|
|
412
|
+
case "e":
|
|
413
|
+
case "E":
|
|
414
|
+
buffer += read();
|
|
415
|
+
lexState = "decimalExponent";
|
|
416
|
+
return;
|
|
417
|
+
case "x":
|
|
418
|
+
case "X":
|
|
419
|
+
buffer += read();
|
|
420
|
+
lexState = "hexadecimal";
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
return newToken("numeric", sign * 0);
|
|
424
|
+
},
|
|
425
|
+
decimalInteger() {
|
|
426
|
+
switch (c) {
|
|
427
|
+
case ".":
|
|
428
|
+
buffer += read();
|
|
429
|
+
lexState = "decimalPoint";
|
|
430
|
+
return;
|
|
431
|
+
case "e":
|
|
432
|
+
case "E":
|
|
433
|
+
buffer += read();
|
|
434
|
+
lexState = "decimalExponent";
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (util.isDigit(c)) {
|
|
438
|
+
buffer += read();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
return newToken("numeric", sign * Number(buffer));
|
|
442
|
+
},
|
|
443
|
+
decimalPointLeading() {
|
|
444
|
+
if (util.isDigit(c)) {
|
|
445
|
+
buffer += read();
|
|
446
|
+
lexState = "decimalFraction";
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
throw invalidChar(read());
|
|
450
|
+
},
|
|
451
|
+
decimalPoint() {
|
|
452
|
+
switch (c) {
|
|
453
|
+
case "e":
|
|
454
|
+
case "E":
|
|
455
|
+
buffer += read();
|
|
456
|
+
lexState = "decimalExponent";
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (util.isDigit(c)) {
|
|
460
|
+
buffer += read();
|
|
461
|
+
lexState = "decimalFraction";
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
return newToken("numeric", sign * Number(buffer));
|
|
465
|
+
},
|
|
466
|
+
decimalFraction() {
|
|
467
|
+
switch (c) {
|
|
468
|
+
case "e":
|
|
469
|
+
case "E":
|
|
470
|
+
buffer += read();
|
|
471
|
+
lexState = "decimalExponent";
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (util.isDigit(c)) {
|
|
475
|
+
buffer += read();
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
return newToken("numeric", sign * Number(buffer));
|
|
479
|
+
},
|
|
480
|
+
decimalExponent() {
|
|
481
|
+
switch (c) {
|
|
482
|
+
case "+":
|
|
483
|
+
case "-":
|
|
484
|
+
buffer += read();
|
|
485
|
+
lexState = "decimalExponentSign";
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if (util.isDigit(c)) {
|
|
489
|
+
buffer += read();
|
|
490
|
+
lexState = "decimalExponentInteger";
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
throw invalidChar(read());
|
|
494
|
+
},
|
|
495
|
+
decimalExponentSign() {
|
|
496
|
+
if (util.isDigit(c)) {
|
|
497
|
+
buffer += read();
|
|
498
|
+
lexState = "decimalExponentInteger";
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
throw invalidChar(read());
|
|
502
|
+
},
|
|
503
|
+
decimalExponentInteger() {
|
|
504
|
+
if (util.isDigit(c)) {
|
|
505
|
+
buffer += read();
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
return newToken("numeric", sign * Number(buffer));
|
|
509
|
+
},
|
|
510
|
+
hexadecimal() {
|
|
511
|
+
if (util.isHexDigit(c)) {
|
|
512
|
+
buffer += read();
|
|
513
|
+
lexState = "hexadecimalInteger";
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
throw invalidChar(read());
|
|
517
|
+
},
|
|
518
|
+
hexadecimalInteger() {
|
|
519
|
+
if (util.isHexDigit(c)) {
|
|
520
|
+
buffer += read();
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
return newToken("numeric", sign * Number(buffer));
|
|
524
|
+
},
|
|
525
|
+
string() {
|
|
526
|
+
switch (c) {
|
|
527
|
+
case "\\":
|
|
528
|
+
read();
|
|
529
|
+
buffer += escape();
|
|
530
|
+
return;
|
|
531
|
+
case '"':
|
|
532
|
+
if (doubleQuote) {
|
|
533
|
+
read();
|
|
534
|
+
return newToken("string", buffer);
|
|
535
|
+
}
|
|
536
|
+
buffer += read();
|
|
537
|
+
return;
|
|
538
|
+
case "'":
|
|
539
|
+
if (!doubleQuote) {
|
|
540
|
+
read();
|
|
541
|
+
return newToken("string", buffer);
|
|
542
|
+
}
|
|
543
|
+
buffer += read();
|
|
544
|
+
return;
|
|
545
|
+
case `
|
|
546
|
+
`:
|
|
547
|
+
case "\r":
|
|
548
|
+
throw invalidChar(read());
|
|
549
|
+
case "\u2028":
|
|
550
|
+
case "\u2029":
|
|
551
|
+
separatorChar(c);
|
|
552
|
+
break;
|
|
553
|
+
case undefined:
|
|
554
|
+
throw invalidChar(read());
|
|
555
|
+
}
|
|
556
|
+
buffer += read();
|
|
557
|
+
},
|
|
558
|
+
start() {
|
|
559
|
+
switch (c) {
|
|
560
|
+
case "{":
|
|
561
|
+
case "[":
|
|
562
|
+
return newToken("punctuator", read());
|
|
563
|
+
}
|
|
564
|
+
lexState = "value";
|
|
565
|
+
},
|
|
566
|
+
beforePropertyName() {
|
|
567
|
+
switch (c) {
|
|
568
|
+
case "$":
|
|
569
|
+
case "_":
|
|
570
|
+
buffer = read();
|
|
571
|
+
lexState = "identifierName";
|
|
572
|
+
return;
|
|
573
|
+
case "\\":
|
|
574
|
+
read();
|
|
575
|
+
lexState = "identifierNameStartEscape";
|
|
576
|
+
return;
|
|
577
|
+
case "}":
|
|
578
|
+
return newToken("punctuator", read());
|
|
579
|
+
case '"':
|
|
580
|
+
case "'":
|
|
581
|
+
doubleQuote = read() === '"';
|
|
582
|
+
lexState = "string";
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (util.isIdStartChar(c)) {
|
|
586
|
+
buffer += read();
|
|
587
|
+
lexState = "identifierName";
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
throw invalidChar(read());
|
|
591
|
+
},
|
|
592
|
+
afterPropertyName() {
|
|
593
|
+
if (c === ":") {
|
|
594
|
+
return newToken("punctuator", read());
|
|
595
|
+
}
|
|
596
|
+
throw invalidChar(read());
|
|
597
|
+
},
|
|
598
|
+
beforePropertyValue() {
|
|
599
|
+
lexState = "value";
|
|
600
|
+
},
|
|
601
|
+
afterPropertyValue() {
|
|
602
|
+
switch (c) {
|
|
603
|
+
case ",":
|
|
604
|
+
case "}":
|
|
605
|
+
return newToken("punctuator", read());
|
|
606
|
+
}
|
|
607
|
+
throw invalidChar(read());
|
|
608
|
+
},
|
|
609
|
+
beforeArrayValue() {
|
|
610
|
+
if (c === "]") {
|
|
611
|
+
return newToken("punctuator", read());
|
|
612
|
+
}
|
|
613
|
+
lexState = "value";
|
|
614
|
+
},
|
|
615
|
+
afterArrayValue() {
|
|
616
|
+
switch (c) {
|
|
617
|
+
case ",":
|
|
618
|
+
case "]":
|
|
619
|
+
return newToken("punctuator", read());
|
|
620
|
+
}
|
|
621
|
+
throw invalidChar(read());
|
|
622
|
+
},
|
|
623
|
+
end() {
|
|
624
|
+
throw invalidChar(read());
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
function newToken(type, value) {
|
|
628
|
+
return {
|
|
629
|
+
type,
|
|
630
|
+
value,
|
|
631
|
+
line,
|
|
632
|
+
column
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
function literal(s) {
|
|
636
|
+
for (const c2 of s) {
|
|
637
|
+
const p = peek();
|
|
638
|
+
if (p !== c2) {
|
|
639
|
+
throw invalidChar(read());
|
|
640
|
+
}
|
|
641
|
+
read();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function escape() {
|
|
645
|
+
const c2 = peek();
|
|
646
|
+
switch (c2) {
|
|
647
|
+
case "b":
|
|
648
|
+
read();
|
|
649
|
+
return "\b";
|
|
650
|
+
case "f":
|
|
651
|
+
read();
|
|
652
|
+
return "\f";
|
|
653
|
+
case "n":
|
|
654
|
+
read();
|
|
655
|
+
return `
|
|
656
|
+
`;
|
|
657
|
+
case "r":
|
|
658
|
+
read();
|
|
659
|
+
return "\r";
|
|
660
|
+
case "t":
|
|
661
|
+
read();
|
|
662
|
+
return "\t";
|
|
663
|
+
case "v":
|
|
664
|
+
read();
|
|
665
|
+
return "\v";
|
|
666
|
+
case "0":
|
|
667
|
+
read();
|
|
668
|
+
if (util.isDigit(peek())) {
|
|
669
|
+
throw invalidChar(read());
|
|
670
|
+
}
|
|
671
|
+
return "\x00";
|
|
672
|
+
case "x":
|
|
673
|
+
read();
|
|
674
|
+
return hexEscape();
|
|
675
|
+
case "u":
|
|
676
|
+
read();
|
|
677
|
+
return unicodeEscape();
|
|
678
|
+
case `
|
|
679
|
+
`:
|
|
680
|
+
case "\u2028":
|
|
681
|
+
case "\u2029":
|
|
682
|
+
read();
|
|
683
|
+
return "";
|
|
684
|
+
case "\r":
|
|
685
|
+
read();
|
|
686
|
+
if (peek() === `
|
|
687
|
+
`) {
|
|
688
|
+
read();
|
|
689
|
+
}
|
|
690
|
+
return "";
|
|
691
|
+
case "1":
|
|
692
|
+
case "2":
|
|
693
|
+
case "3":
|
|
694
|
+
case "4":
|
|
695
|
+
case "5":
|
|
696
|
+
case "6":
|
|
697
|
+
case "7":
|
|
698
|
+
case "8":
|
|
699
|
+
case "9":
|
|
700
|
+
throw invalidChar(read());
|
|
701
|
+
case undefined:
|
|
702
|
+
throw invalidChar(read());
|
|
703
|
+
}
|
|
704
|
+
return read();
|
|
705
|
+
}
|
|
706
|
+
function hexEscape() {
|
|
707
|
+
let buffer2 = "";
|
|
708
|
+
let c2 = peek();
|
|
709
|
+
if (!util.isHexDigit(c2)) {
|
|
710
|
+
throw invalidChar(read());
|
|
711
|
+
}
|
|
712
|
+
buffer2 += read();
|
|
713
|
+
c2 = peek();
|
|
714
|
+
if (!util.isHexDigit(c2)) {
|
|
715
|
+
throw invalidChar(read());
|
|
716
|
+
}
|
|
717
|
+
buffer2 += read();
|
|
718
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
719
|
+
}
|
|
720
|
+
function unicodeEscape() {
|
|
721
|
+
let buffer2 = "";
|
|
722
|
+
let count = 4;
|
|
723
|
+
while (count-- > 0) {
|
|
724
|
+
const c2 = peek();
|
|
725
|
+
if (!util.isHexDigit(c2)) {
|
|
726
|
+
throw invalidChar(read());
|
|
727
|
+
}
|
|
728
|
+
buffer2 += read();
|
|
729
|
+
}
|
|
730
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
731
|
+
}
|
|
732
|
+
var parseStates = {
|
|
733
|
+
start() {
|
|
734
|
+
if (token.type === "eof") {
|
|
735
|
+
throw invalidEOF();
|
|
736
|
+
}
|
|
737
|
+
push();
|
|
738
|
+
},
|
|
739
|
+
beforePropertyName() {
|
|
740
|
+
switch (token.type) {
|
|
741
|
+
case "identifier":
|
|
742
|
+
case "string":
|
|
743
|
+
key = token.value;
|
|
744
|
+
parseState = "afterPropertyName";
|
|
745
|
+
return;
|
|
746
|
+
case "punctuator":
|
|
747
|
+
pop();
|
|
748
|
+
return;
|
|
749
|
+
case "eof":
|
|
750
|
+
throw invalidEOF();
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
afterPropertyName() {
|
|
754
|
+
if (token.type === "eof") {
|
|
755
|
+
throw invalidEOF();
|
|
756
|
+
}
|
|
757
|
+
parseState = "beforePropertyValue";
|
|
758
|
+
},
|
|
759
|
+
beforePropertyValue() {
|
|
760
|
+
if (token.type === "eof") {
|
|
761
|
+
throw invalidEOF();
|
|
762
|
+
}
|
|
763
|
+
push();
|
|
764
|
+
},
|
|
765
|
+
beforeArrayValue() {
|
|
766
|
+
if (token.type === "eof") {
|
|
767
|
+
throw invalidEOF();
|
|
768
|
+
}
|
|
769
|
+
if (token.type === "punctuator" && token.value === "]") {
|
|
770
|
+
pop();
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
push();
|
|
774
|
+
},
|
|
775
|
+
afterPropertyValue() {
|
|
776
|
+
if (token.type === "eof") {
|
|
777
|
+
throw invalidEOF();
|
|
778
|
+
}
|
|
779
|
+
switch (token.value) {
|
|
780
|
+
case ",":
|
|
781
|
+
parseState = "beforePropertyName";
|
|
782
|
+
return;
|
|
783
|
+
case "}":
|
|
784
|
+
pop();
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
afterArrayValue() {
|
|
788
|
+
if (token.type === "eof") {
|
|
789
|
+
throw invalidEOF();
|
|
790
|
+
}
|
|
791
|
+
switch (token.value) {
|
|
792
|
+
case ",":
|
|
793
|
+
parseState = "beforeArrayValue";
|
|
794
|
+
return;
|
|
795
|
+
case "]":
|
|
796
|
+
pop();
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
end() {}
|
|
800
|
+
};
|
|
801
|
+
function push() {
|
|
802
|
+
let value;
|
|
803
|
+
switch (token.type) {
|
|
804
|
+
case "punctuator":
|
|
805
|
+
switch (token.value) {
|
|
806
|
+
case "{":
|
|
807
|
+
value = {};
|
|
808
|
+
break;
|
|
809
|
+
case "[":
|
|
810
|
+
value = [];
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
break;
|
|
814
|
+
case "null":
|
|
815
|
+
case "boolean":
|
|
816
|
+
case "numeric":
|
|
817
|
+
case "string":
|
|
818
|
+
value = token.value;
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
if (root === undefined) {
|
|
822
|
+
root = value;
|
|
823
|
+
} else {
|
|
824
|
+
const parent = stack[stack.length - 1];
|
|
825
|
+
if (Array.isArray(parent)) {
|
|
826
|
+
parent.push(value);
|
|
827
|
+
} else {
|
|
828
|
+
Object.defineProperty(parent, key, {
|
|
829
|
+
value,
|
|
830
|
+
writable: true,
|
|
831
|
+
enumerable: true,
|
|
832
|
+
configurable: true
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
if (value !== null && typeof value === "object") {
|
|
837
|
+
stack.push(value);
|
|
838
|
+
if (Array.isArray(value)) {
|
|
839
|
+
parseState = "beforeArrayValue";
|
|
840
|
+
} else {
|
|
841
|
+
parseState = "beforePropertyName";
|
|
842
|
+
}
|
|
843
|
+
} else {
|
|
844
|
+
const current = stack[stack.length - 1];
|
|
845
|
+
if (current == null) {
|
|
846
|
+
parseState = "end";
|
|
847
|
+
} else if (Array.isArray(current)) {
|
|
848
|
+
parseState = "afterArrayValue";
|
|
849
|
+
} else {
|
|
850
|
+
parseState = "afterPropertyValue";
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function pop() {
|
|
855
|
+
stack.pop();
|
|
856
|
+
const current = stack[stack.length - 1];
|
|
857
|
+
if (current == null) {
|
|
858
|
+
parseState = "end";
|
|
859
|
+
} else if (Array.isArray(current)) {
|
|
860
|
+
parseState = "afterArrayValue";
|
|
861
|
+
} else {
|
|
862
|
+
parseState = "afterPropertyValue";
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function invalidChar(c2) {
|
|
866
|
+
if (c2 === undefined) {
|
|
867
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
868
|
+
}
|
|
869
|
+
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
870
|
+
}
|
|
871
|
+
function invalidEOF() {
|
|
872
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
873
|
+
}
|
|
874
|
+
function invalidIdentifier() {
|
|
875
|
+
column -= 5;
|
|
876
|
+
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
877
|
+
}
|
|
878
|
+
function separatorChar(c2) {
|
|
879
|
+
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
880
|
+
}
|
|
881
|
+
function formatChar(c2) {
|
|
882
|
+
const replacements = {
|
|
883
|
+
"'": "\\'",
|
|
884
|
+
'"': "\\\"",
|
|
885
|
+
"\\": "\\\\",
|
|
886
|
+
"\b": "\\b",
|
|
887
|
+
"\f": "\\f",
|
|
888
|
+
"\n": "\\n",
|
|
889
|
+
"\r": "\\r",
|
|
890
|
+
"\t": "\\t",
|
|
891
|
+
"\v": "\\v",
|
|
892
|
+
"\x00": "\\0",
|
|
893
|
+
"\u2028": "\\u2028",
|
|
894
|
+
"\u2029": "\\u2029"
|
|
895
|
+
};
|
|
896
|
+
if (replacements[c2]) {
|
|
897
|
+
return replacements[c2];
|
|
898
|
+
}
|
|
899
|
+
if (c2 < " ") {
|
|
900
|
+
const hexString = c2.charCodeAt(0).toString(16);
|
|
901
|
+
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
902
|
+
}
|
|
903
|
+
return c2;
|
|
904
|
+
}
|
|
905
|
+
function syntaxError(message) {
|
|
906
|
+
const err = new SyntaxError(message);
|
|
907
|
+
err.lineNumber = line;
|
|
908
|
+
err.columnNumber = column;
|
|
909
|
+
return err;
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// ../../node_modules/.bun/json5@2.2.3/node_modules/json5/lib/stringify.js
|
|
914
|
+
var require_stringify = __commonJS((exports, module) => {
|
|
915
|
+
var util = require_util();
|
|
916
|
+
module.exports = function stringify(value, replacer, space) {
|
|
917
|
+
const stack = [];
|
|
918
|
+
let indent = "";
|
|
919
|
+
let propertyList;
|
|
920
|
+
let replacerFunc;
|
|
921
|
+
let gap = "";
|
|
922
|
+
let quote;
|
|
923
|
+
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
|
|
924
|
+
space = replacer.space;
|
|
925
|
+
quote = replacer.quote;
|
|
926
|
+
replacer = replacer.replacer;
|
|
927
|
+
}
|
|
928
|
+
if (typeof replacer === "function") {
|
|
929
|
+
replacerFunc = replacer;
|
|
930
|
+
} else if (Array.isArray(replacer)) {
|
|
931
|
+
propertyList = [];
|
|
932
|
+
for (const v of replacer) {
|
|
933
|
+
let item;
|
|
934
|
+
if (typeof v === "string") {
|
|
935
|
+
item = v;
|
|
936
|
+
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
|
|
937
|
+
item = String(v);
|
|
938
|
+
}
|
|
939
|
+
if (item !== undefined && propertyList.indexOf(item) < 0) {
|
|
940
|
+
propertyList.push(item);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
if (space instanceof Number) {
|
|
945
|
+
space = Number(space);
|
|
946
|
+
} else if (space instanceof String) {
|
|
947
|
+
space = String(space);
|
|
948
|
+
}
|
|
949
|
+
if (typeof space === "number") {
|
|
950
|
+
if (space > 0) {
|
|
951
|
+
space = Math.min(10, Math.floor(space));
|
|
952
|
+
gap = " ".substr(0, space);
|
|
953
|
+
}
|
|
954
|
+
} else if (typeof space === "string") {
|
|
955
|
+
gap = space.substr(0, 10);
|
|
956
|
+
}
|
|
957
|
+
return serializeProperty("", { "": value });
|
|
958
|
+
function serializeProperty(key, holder) {
|
|
959
|
+
let value2 = holder[key];
|
|
960
|
+
if (value2 != null) {
|
|
961
|
+
if (typeof value2.toJSON5 === "function") {
|
|
962
|
+
value2 = value2.toJSON5(key);
|
|
963
|
+
} else if (typeof value2.toJSON === "function") {
|
|
964
|
+
value2 = value2.toJSON(key);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
if (replacerFunc) {
|
|
968
|
+
value2 = replacerFunc.call(holder, key, value2);
|
|
969
|
+
}
|
|
970
|
+
if (value2 instanceof Number) {
|
|
971
|
+
value2 = Number(value2);
|
|
972
|
+
} else if (value2 instanceof String) {
|
|
973
|
+
value2 = String(value2);
|
|
974
|
+
} else if (value2 instanceof Boolean) {
|
|
975
|
+
value2 = value2.valueOf();
|
|
976
|
+
}
|
|
977
|
+
switch (value2) {
|
|
978
|
+
case null:
|
|
979
|
+
return "null";
|
|
980
|
+
case true:
|
|
981
|
+
return "true";
|
|
982
|
+
case false:
|
|
983
|
+
return "false";
|
|
984
|
+
}
|
|
985
|
+
if (typeof value2 === "string") {
|
|
986
|
+
return quoteString(value2, false);
|
|
987
|
+
}
|
|
988
|
+
if (typeof value2 === "number") {
|
|
989
|
+
return String(value2);
|
|
990
|
+
}
|
|
991
|
+
if (typeof value2 === "object") {
|
|
992
|
+
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
993
|
+
}
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
function quoteString(value2) {
|
|
997
|
+
const quotes = {
|
|
998
|
+
"'": 0.1,
|
|
999
|
+
'"': 0.2
|
|
1000
|
+
};
|
|
1001
|
+
const replacements = {
|
|
1002
|
+
"'": "\\'",
|
|
1003
|
+
'"': "\\\"",
|
|
1004
|
+
"\\": "\\\\",
|
|
1005
|
+
"\b": "\\b",
|
|
1006
|
+
"\f": "\\f",
|
|
1007
|
+
"\n": "\\n",
|
|
1008
|
+
"\r": "\\r",
|
|
1009
|
+
"\t": "\\t",
|
|
1010
|
+
"\v": "\\v",
|
|
1011
|
+
"\x00": "\\0",
|
|
1012
|
+
"\u2028": "\\u2028",
|
|
1013
|
+
"\u2029": "\\u2029"
|
|
1014
|
+
};
|
|
1015
|
+
let product = "";
|
|
1016
|
+
for (let i = 0;i < value2.length; i++) {
|
|
1017
|
+
const c = value2[i];
|
|
1018
|
+
switch (c) {
|
|
1019
|
+
case "'":
|
|
1020
|
+
case '"':
|
|
1021
|
+
quotes[c]++;
|
|
1022
|
+
product += c;
|
|
1023
|
+
continue;
|
|
1024
|
+
case "\x00":
|
|
1025
|
+
if (util.isDigit(value2[i + 1])) {
|
|
1026
|
+
product += "\\x00";
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (replacements[c]) {
|
|
1031
|
+
product += replacements[c];
|
|
1032
|
+
continue;
|
|
1033
|
+
}
|
|
1034
|
+
if (c < " ") {
|
|
1035
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
1036
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
product += c;
|
|
1040
|
+
}
|
|
1041
|
+
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1042
|
+
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
1043
|
+
return quoteChar + product + quoteChar;
|
|
1044
|
+
}
|
|
1045
|
+
function serializeObject(value2) {
|
|
1046
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1047
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1048
|
+
}
|
|
1049
|
+
stack.push(value2);
|
|
1050
|
+
let stepback = indent;
|
|
1051
|
+
indent = indent + gap;
|
|
1052
|
+
let keys = propertyList || Object.keys(value2);
|
|
1053
|
+
let partial = [];
|
|
1054
|
+
for (const key of keys) {
|
|
1055
|
+
const propertyString = serializeProperty(key, value2);
|
|
1056
|
+
if (propertyString !== undefined) {
|
|
1057
|
+
let member = serializeKey(key) + ":";
|
|
1058
|
+
if (gap !== "") {
|
|
1059
|
+
member += " ";
|
|
1060
|
+
}
|
|
1061
|
+
member += propertyString;
|
|
1062
|
+
partial.push(member);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
let final;
|
|
1066
|
+
if (partial.length === 0) {
|
|
1067
|
+
final = "{}";
|
|
1068
|
+
} else {
|
|
1069
|
+
let properties;
|
|
1070
|
+
if (gap === "") {
|
|
1071
|
+
properties = partial.join(",");
|
|
1072
|
+
final = "{" + properties + "}";
|
|
1073
|
+
} else {
|
|
1074
|
+
let separator = `,
|
|
1075
|
+
` + indent;
|
|
1076
|
+
properties = partial.join(separator);
|
|
1077
|
+
final = `{
|
|
1078
|
+
` + indent + properties + `,
|
|
1079
|
+
` + stepback + "}";
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
stack.pop();
|
|
1083
|
+
indent = stepback;
|
|
1084
|
+
return final;
|
|
1085
|
+
}
|
|
1086
|
+
function serializeKey(key) {
|
|
1087
|
+
if (key.length === 0) {
|
|
1088
|
+
return quoteString(key, true);
|
|
1089
|
+
}
|
|
1090
|
+
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1091
|
+
if (!util.isIdStartChar(firstChar)) {
|
|
1092
|
+
return quoteString(key, true);
|
|
1093
|
+
}
|
|
1094
|
+
for (let i = firstChar.length;i < key.length; i++) {
|
|
1095
|
+
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
1096
|
+
return quoteString(key, true);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
return key;
|
|
1100
|
+
}
|
|
1101
|
+
function serializeArray(value2) {
|
|
1102
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1103
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1104
|
+
}
|
|
1105
|
+
stack.push(value2);
|
|
1106
|
+
let stepback = indent;
|
|
1107
|
+
indent = indent + gap;
|
|
1108
|
+
let partial = [];
|
|
1109
|
+
for (let i = 0;i < value2.length; i++) {
|
|
1110
|
+
const propertyString = serializeProperty(String(i), value2);
|
|
1111
|
+
partial.push(propertyString !== undefined ? propertyString : "null");
|
|
1112
|
+
}
|
|
1113
|
+
let final;
|
|
1114
|
+
if (partial.length === 0) {
|
|
1115
|
+
final = "[]";
|
|
1116
|
+
} else {
|
|
1117
|
+
if (gap === "") {
|
|
1118
|
+
let properties = partial.join(",");
|
|
1119
|
+
final = "[" + properties + "]";
|
|
1120
|
+
} else {
|
|
1121
|
+
let separator = `,
|
|
1122
|
+
` + indent;
|
|
1123
|
+
let properties = partial.join(separator);
|
|
1124
|
+
final = `[
|
|
1125
|
+
` + indent + properties + `,
|
|
1126
|
+
` + stepback + "]";
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
stack.pop();
|
|
1130
|
+
indent = stepback;
|
|
1131
|
+
return final;
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
});
|
|
1135
|
+
|
|
1136
|
+
// ../../node_modules/.bun/json5@2.2.3/node_modules/json5/lib/index.js
|
|
1137
|
+
var require_lib = __commonJS((exports, module) => {
|
|
1138
|
+
var parse = require_parse();
|
|
1139
|
+
var stringify = require_stringify();
|
|
1140
|
+
var JSON5 = {
|
|
1141
|
+
parse,
|
|
1142
|
+
stringify
|
|
1143
|
+
};
|
|
1144
|
+
module.exports = JSON5;
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
// src/lenient-json.ts
|
|
1148
|
+
var import_json5 = __toESM(require_lib(), 1);
|
|
1149
|
+
|
|
1150
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
1151
|
+
function createScanner(text, ignoreTrivia = false) {
|
|
1152
|
+
const len = text.length;
|
|
1153
|
+
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
1154
|
+
function scanHexDigits(count, exact) {
|
|
1155
|
+
let digits = 0;
|
|
1156
|
+
let value2 = 0;
|
|
1157
|
+
while (digits < count || !exact) {
|
|
1158
|
+
let ch = text.charCodeAt(pos);
|
|
1159
|
+
if (ch >= 48 && ch <= 57) {
|
|
1160
|
+
value2 = value2 * 16 + ch - 48;
|
|
1161
|
+
} else if (ch >= 65 && ch <= 70) {
|
|
1162
|
+
value2 = value2 * 16 + ch - 65 + 10;
|
|
1163
|
+
} else if (ch >= 97 && ch <= 102) {
|
|
1164
|
+
value2 = value2 * 16 + ch - 97 + 10;
|
|
1165
|
+
} else {
|
|
1166
|
+
break;
|
|
1167
|
+
}
|
|
1168
|
+
pos++;
|
|
1169
|
+
digits++;
|
|
1170
|
+
}
|
|
1171
|
+
if (digits < count) {
|
|
1172
|
+
value2 = -1;
|
|
1173
|
+
}
|
|
1174
|
+
return value2;
|
|
1175
|
+
}
|
|
1176
|
+
function setPosition(newPosition) {
|
|
1177
|
+
pos = newPosition;
|
|
1178
|
+
value = "";
|
|
1179
|
+
tokenOffset = 0;
|
|
1180
|
+
token = 16;
|
|
1181
|
+
scanError = 0;
|
|
1182
|
+
}
|
|
1183
|
+
function scanNumber() {
|
|
1184
|
+
let start = pos;
|
|
1185
|
+
if (text.charCodeAt(pos) === 48) {
|
|
1186
|
+
pos++;
|
|
1187
|
+
} else {
|
|
1188
|
+
pos++;
|
|
1189
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1190
|
+
pos++;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
if (pos < text.length && text.charCodeAt(pos) === 46) {
|
|
1194
|
+
pos++;
|
|
1195
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1196
|
+
pos++;
|
|
1197
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1198
|
+
pos++;
|
|
1199
|
+
}
|
|
1200
|
+
} else {
|
|
1201
|
+
scanError = 3;
|
|
1202
|
+
return text.substring(start, pos);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
let end = pos;
|
|
1206
|
+
if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
|
|
1207
|
+
pos++;
|
|
1208
|
+
if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
|
|
1209
|
+
pos++;
|
|
1210
|
+
}
|
|
1211
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1212
|
+
pos++;
|
|
1213
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1214
|
+
pos++;
|
|
1215
|
+
}
|
|
1216
|
+
end = pos;
|
|
1217
|
+
} else {
|
|
1218
|
+
scanError = 3;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
return text.substring(start, end);
|
|
1222
|
+
}
|
|
1223
|
+
function scanString() {
|
|
1224
|
+
let result = "", start = pos;
|
|
1225
|
+
while (true) {
|
|
1226
|
+
if (pos >= len) {
|
|
1227
|
+
result += text.substring(start, pos);
|
|
1228
|
+
scanError = 2;
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
const ch = text.charCodeAt(pos);
|
|
1232
|
+
if (ch === 34) {
|
|
1233
|
+
result += text.substring(start, pos);
|
|
1234
|
+
pos++;
|
|
1235
|
+
break;
|
|
1236
|
+
}
|
|
1237
|
+
if (ch === 92) {
|
|
1238
|
+
result += text.substring(start, pos);
|
|
1239
|
+
pos++;
|
|
1240
|
+
if (pos >= len) {
|
|
1241
|
+
scanError = 2;
|
|
1242
|
+
break;
|
|
1243
|
+
}
|
|
1244
|
+
const ch2 = text.charCodeAt(pos++);
|
|
1245
|
+
switch (ch2) {
|
|
1246
|
+
case 34:
|
|
1247
|
+
result += '"';
|
|
1248
|
+
break;
|
|
1249
|
+
case 92:
|
|
1250
|
+
result += "\\";
|
|
1251
|
+
break;
|
|
1252
|
+
case 47:
|
|
1253
|
+
result += "/";
|
|
1254
|
+
break;
|
|
1255
|
+
case 98:
|
|
1256
|
+
result += "\b";
|
|
1257
|
+
break;
|
|
1258
|
+
case 102:
|
|
1259
|
+
result += "\f";
|
|
1260
|
+
break;
|
|
1261
|
+
case 110:
|
|
1262
|
+
result += `
|
|
1263
|
+
`;
|
|
1264
|
+
break;
|
|
1265
|
+
case 114:
|
|
1266
|
+
result += "\r";
|
|
1267
|
+
break;
|
|
1268
|
+
case 116:
|
|
1269
|
+
result += "\t";
|
|
1270
|
+
break;
|
|
1271
|
+
case 117:
|
|
1272
|
+
const ch3 = scanHexDigits(4, true);
|
|
1273
|
+
if (ch3 >= 0) {
|
|
1274
|
+
result += String.fromCharCode(ch3);
|
|
1275
|
+
} else {
|
|
1276
|
+
scanError = 4;
|
|
1277
|
+
}
|
|
1278
|
+
break;
|
|
1279
|
+
default:
|
|
1280
|
+
scanError = 5;
|
|
1281
|
+
}
|
|
1282
|
+
start = pos;
|
|
1283
|
+
continue;
|
|
1284
|
+
}
|
|
1285
|
+
if (ch >= 0 && ch <= 31) {
|
|
1286
|
+
if (isLineBreak(ch)) {
|
|
1287
|
+
result += text.substring(start, pos);
|
|
1288
|
+
scanError = 2;
|
|
1289
|
+
break;
|
|
1290
|
+
} else {
|
|
1291
|
+
scanError = 6;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
pos++;
|
|
1295
|
+
}
|
|
1296
|
+
return result;
|
|
1297
|
+
}
|
|
1298
|
+
function scanNext() {
|
|
1299
|
+
value = "";
|
|
1300
|
+
scanError = 0;
|
|
1301
|
+
tokenOffset = pos;
|
|
1302
|
+
lineStartOffset = lineNumber;
|
|
1303
|
+
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
1304
|
+
if (pos >= len) {
|
|
1305
|
+
tokenOffset = len;
|
|
1306
|
+
return token = 17;
|
|
1307
|
+
}
|
|
1308
|
+
let code = text.charCodeAt(pos);
|
|
1309
|
+
if (isWhiteSpace(code)) {
|
|
1310
|
+
do {
|
|
1311
|
+
pos++;
|
|
1312
|
+
value += String.fromCharCode(code);
|
|
1313
|
+
code = text.charCodeAt(pos);
|
|
1314
|
+
} while (isWhiteSpace(code));
|
|
1315
|
+
return token = 15;
|
|
1316
|
+
}
|
|
1317
|
+
if (isLineBreak(code)) {
|
|
1318
|
+
pos++;
|
|
1319
|
+
value += String.fromCharCode(code);
|
|
1320
|
+
if (code === 13 && text.charCodeAt(pos) === 10) {
|
|
1321
|
+
pos++;
|
|
1322
|
+
value += `
|
|
1323
|
+
`;
|
|
1324
|
+
}
|
|
1325
|
+
lineNumber++;
|
|
1326
|
+
tokenLineStartOffset = pos;
|
|
1327
|
+
return token = 14;
|
|
1328
|
+
}
|
|
1329
|
+
switch (code) {
|
|
1330
|
+
case 123:
|
|
1331
|
+
pos++;
|
|
1332
|
+
return token = 1;
|
|
1333
|
+
case 125:
|
|
1334
|
+
pos++;
|
|
1335
|
+
return token = 2;
|
|
1336
|
+
case 91:
|
|
1337
|
+
pos++;
|
|
1338
|
+
return token = 3;
|
|
1339
|
+
case 93:
|
|
1340
|
+
pos++;
|
|
1341
|
+
return token = 4;
|
|
1342
|
+
case 58:
|
|
1343
|
+
pos++;
|
|
1344
|
+
return token = 6;
|
|
1345
|
+
case 44:
|
|
1346
|
+
pos++;
|
|
1347
|
+
return token = 5;
|
|
1348
|
+
case 34:
|
|
1349
|
+
pos++;
|
|
1350
|
+
value = scanString();
|
|
1351
|
+
return token = 10;
|
|
1352
|
+
case 47:
|
|
1353
|
+
const start = pos - 1;
|
|
1354
|
+
if (text.charCodeAt(pos + 1) === 47) {
|
|
1355
|
+
pos += 2;
|
|
1356
|
+
while (pos < len) {
|
|
1357
|
+
if (isLineBreak(text.charCodeAt(pos))) {
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
pos++;
|
|
1361
|
+
}
|
|
1362
|
+
value = text.substring(start, pos);
|
|
1363
|
+
return token = 12;
|
|
1364
|
+
}
|
|
1365
|
+
if (text.charCodeAt(pos + 1) === 42) {
|
|
1366
|
+
pos += 2;
|
|
1367
|
+
const safeLength = len - 1;
|
|
1368
|
+
let commentClosed = false;
|
|
1369
|
+
while (pos < safeLength) {
|
|
1370
|
+
const ch = text.charCodeAt(pos);
|
|
1371
|
+
if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
|
|
1372
|
+
pos += 2;
|
|
1373
|
+
commentClosed = true;
|
|
1374
|
+
break;
|
|
1375
|
+
}
|
|
1376
|
+
pos++;
|
|
1377
|
+
if (isLineBreak(ch)) {
|
|
1378
|
+
if (ch === 13 && text.charCodeAt(pos) === 10) {
|
|
1379
|
+
pos++;
|
|
1380
|
+
}
|
|
1381
|
+
lineNumber++;
|
|
1382
|
+
tokenLineStartOffset = pos;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
if (!commentClosed) {
|
|
1386
|
+
pos++;
|
|
1387
|
+
scanError = 1;
|
|
1388
|
+
}
|
|
1389
|
+
value = text.substring(start, pos);
|
|
1390
|
+
return token = 13;
|
|
1391
|
+
}
|
|
1392
|
+
value += String.fromCharCode(code);
|
|
1393
|
+
pos++;
|
|
1394
|
+
return token = 16;
|
|
1395
|
+
case 45:
|
|
1396
|
+
value += String.fromCharCode(code);
|
|
1397
|
+
pos++;
|
|
1398
|
+
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
1399
|
+
return token = 16;
|
|
1400
|
+
}
|
|
1401
|
+
case 48:
|
|
1402
|
+
case 49:
|
|
1403
|
+
case 50:
|
|
1404
|
+
case 51:
|
|
1405
|
+
case 52:
|
|
1406
|
+
case 53:
|
|
1407
|
+
case 54:
|
|
1408
|
+
case 55:
|
|
1409
|
+
case 56:
|
|
1410
|
+
case 57:
|
|
1411
|
+
value += scanNumber();
|
|
1412
|
+
return token = 11;
|
|
1413
|
+
default:
|
|
1414
|
+
while (pos < len && isUnknownContentCharacter(code)) {
|
|
1415
|
+
pos++;
|
|
1416
|
+
code = text.charCodeAt(pos);
|
|
1417
|
+
}
|
|
1418
|
+
if (tokenOffset !== pos) {
|
|
1419
|
+
value = text.substring(tokenOffset, pos);
|
|
1420
|
+
switch (value) {
|
|
1421
|
+
case "true":
|
|
1422
|
+
return token = 8;
|
|
1423
|
+
case "false":
|
|
1424
|
+
return token = 9;
|
|
1425
|
+
case "null":
|
|
1426
|
+
return token = 7;
|
|
1427
|
+
}
|
|
1428
|
+
return token = 16;
|
|
1429
|
+
}
|
|
1430
|
+
value += String.fromCharCode(code);
|
|
1431
|
+
pos++;
|
|
1432
|
+
return token = 16;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
function isUnknownContentCharacter(code) {
|
|
1436
|
+
if (isWhiteSpace(code) || isLineBreak(code)) {
|
|
1437
|
+
return false;
|
|
1438
|
+
}
|
|
1439
|
+
switch (code) {
|
|
1440
|
+
case 125:
|
|
1441
|
+
case 93:
|
|
1442
|
+
case 123:
|
|
1443
|
+
case 91:
|
|
1444
|
+
case 34:
|
|
1445
|
+
case 58:
|
|
1446
|
+
case 44:
|
|
1447
|
+
case 47:
|
|
1448
|
+
return false;
|
|
1449
|
+
}
|
|
1450
|
+
return true;
|
|
1451
|
+
}
|
|
1452
|
+
function scanNextNonTrivia() {
|
|
1453
|
+
let result;
|
|
1454
|
+
do {
|
|
1455
|
+
result = scanNext();
|
|
1456
|
+
} while (result >= 12 && result <= 15);
|
|
1457
|
+
return result;
|
|
1458
|
+
}
|
|
1459
|
+
return {
|
|
1460
|
+
setPosition,
|
|
1461
|
+
getPosition: () => pos,
|
|
1462
|
+
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
1463
|
+
getToken: () => token,
|
|
1464
|
+
getTokenValue: () => value,
|
|
1465
|
+
getTokenOffset: () => tokenOffset,
|
|
1466
|
+
getTokenLength: () => pos - tokenOffset,
|
|
1467
|
+
getTokenStartLine: () => lineStartOffset,
|
|
1468
|
+
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
1469
|
+
getTokenError: () => scanError
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
function isWhiteSpace(ch) {
|
|
1473
|
+
return ch === 32 || ch === 9;
|
|
1474
|
+
}
|
|
1475
|
+
function isLineBreak(ch) {
|
|
1476
|
+
return ch === 10 || ch === 13;
|
|
1477
|
+
}
|
|
1478
|
+
function isDigit(ch) {
|
|
1479
|
+
return ch >= 48 && ch <= 57;
|
|
1480
|
+
}
|
|
1481
|
+
var CharacterCodes;
|
|
1482
|
+
(function(CharacterCodes2) {
|
|
1483
|
+
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
1484
|
+
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
1485
|
+
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
1486
|
+
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
1487
|
+
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
1488
|
+
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
1489
|
+
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
1490
|
+
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
1491
|
+
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
1492
|
+
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
1493
|
+
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
1494
|
+
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
1495
|
+
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
1496
|
+
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
1497
|
+
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
1498
|
+
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
1499
|
+
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
1500
|
+
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
1501
|
+
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
1502
|
+
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
1503
|
+
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
1504
|
+
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
1505
|
+
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
1506
|
+
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
1507
|
+
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
1508
|
+
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
1509
|
+
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
1510
|
+
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
1511
|
+
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
1512
|
+
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
1513
|
+
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
1514
|
+
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
1515
|
+
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
1516
|
+
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
1517
|
+
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
1518
|
+
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
1519
|
+
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
1520
|
+
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
1521
|
+
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
1522
|
+
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
1523
|
+
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
1524
|
+
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
1525
|
+
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
1526
|
+
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
1527
|
+
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
1528
|
+
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
1529
|
+
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
1530
|
+
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
1531
|
+
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
1532
|
+
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
1533
|
+
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
1534
|
+
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
1535
|
+
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
1536
|
+
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
1537
|
+
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
1538
|
+
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
1539
|
+
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
1540
|
+
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
1541
|
+
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
1542
|
+
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
1543
|
+
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
1544
|
+
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
1545
|
+
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
1546
|
+
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
1547
|
+
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
1548
|
+
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
1549
|
+
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
1550
|
+
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
1551
|
+
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
1552
|
+
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
1553
|
+
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
1554
|
+
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
1555
|
+
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
1556
|
+
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
1557
|
+
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
1558
|
+
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
1559
|
+
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
1560
|
+
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
1561
|
+
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
1562
|
+
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
1563
|
+
})(CharacterCodes || (CharacterCodes = {}));
|
|
1564
|
+
|
|
1565
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
1566
|
+
var cachedSpaces = new Array(20).fill(0).map((_, index) => {
|
|
1567
|
+
return " ".repeat(index);
|
|
1568
|
+
});
|
|
1569
|
+
var maxCachedValues = 200;
|
|
1570
|
+
var cachedBreakLinesWithSpaces = {
|
|
1571
|
+
" ": {
|
|
1572
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1573
|
+
return `
|
|
1574
|
+
` + " ".repeat(index);
|
|
1575
|
+
}),
|
|
1576
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1577
|
+
return "\r" + " ".repeat(index);
|
|
1578
|
+
}),
|
|
1579
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1580
|
+
return `\r
|
|
1581
|
+
` + " ".repeat(index);
|
|
1582
|
+
})
|
|
1583
|
+
},
|
|
1584
|
+
"\t": {
|
|
1585
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1586
|
+
return `
|
|
1587
|
+
` + "\t".repeat(index);
|
|
1588
|
+
}),
|
|
1589
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1590
|
+
return "\r" + "\t".repeat(index);
|
|
1591
|
+
}),
|
|
1592
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
1593
|
+
return `\r
|
|
1594
|
+
` + "\t".repeat(index);
|
|
1595
|
+
})
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
1600
|
+
var ParseOptions;
|
|
1601
|
+
(function(ParseOptions2) {
|
|
1602
|
+
ParseOptions2.DEFAULT = {
|
|
1603
|
+
allowTrailingComma: false
|
|
1604
|
+
};
|
|
1605
|
+
})(ParseOptions || (ParseOptions = {}));
|
|
1606
|
+
function parse(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
1607
|
+
let currentProperty = null;
|
|
1608
|
+
let currentParent = [];
|
|
1609
|
+
const previousParents = [];
|
|
1610
|
+
function onValue(value) {
|
|
1611
|
+
if (Array.isArray(currentParent)) {
|
|
1612
|
+
currentParent.push(value);
|
|
1613
|
+
} else if (currentProperty !== null) {
|
|
1614
|
+
currentParent[currentProperty] = value;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
const visitor = {
|
|
1618
|
+
onObjectBegin: () => {
|
|
1619
|
+
const object = {};
|
|
1620
|
+
onValue(object);
|
|
1621
|
+
previousParents.push(currentParent);
|
|
1622
|
+
currentParent = object;
|
|
1623
|
+
currentProperty = null;
|
|
1624
|
+
},
|
|
1625
|
+
onObjectProperty: (name) => {
|
|
1626
|
+
currentProperty = name;
|
|
1627
|
+
},
|
|
1628
|
+
onObjectEnd: () => {
|
|
1629
|
+
currentParent = previousParents.pop();
|
|
1630
|
+
},
|
|
1631
|
+
onArrayBegin: () => {
|
|
1632
|
+
const array = [];
|
|
1633
|
+
onValue(array);
|
|
1634
|
+
previousParents.push(currentParent);
|
|
1635
|
+
currentParent = array;
|
|
1636
|
+
currentProperty = null;
|
|
1637
|
+
},
|
|
1638
|
+
onArrayEnd: () => {
|
|
1639
|
+
currentParent = previousParents.pop();
|
|
1640
|
+
},
|
|
1641
|
+
onLiteralValue: onValue,
|
|
1642
|
+
onError: (error, offset, length) => {
|
|
1643
|
+
errors.push({ error, offset, length });
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
visit(text, visitor, options);
|
|
1647
|
+
return currentParent[0];
|
|
1648
|
+
}
|
|
1649
|
+
function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
1650
|
+
const _scanner = createScanner(text, false);
|
|
1651
|
+
const _jsonPath = [];
|
|
1652
|
+
let suppressedCallbacks = 0;
|
|
1653
|
+
function toNoArgVisit(visitFunction) {
|
|
1654
|
+
return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
1655
|
+
}
|
|
1656
|
+
function toOneArgVisit(visitFunction) {
|
|
1657
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
1658
|
+
}
|
|
1659
|
+
function toOneArgVisitWithPath(visitFunction) {
|
|
1660
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
1661
|
+
}
|
|
1662
|
+
function toBeginVisit(visitFunction) {
|
|
1663
|
+
return visitFunction ? () => {
|
|
1664
|
+
if (suppressedCallbacks > 0) {
|
|
1665
|
+
suppressedCallbacks++;
|
|
1666
|
+
} else {
|
|
1667
|
+
let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
|
|
1668
|
+
if (cbReturn === false) {
|
|
1669
|
+
suppressedCallbacks = 1;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
} : () => true;
|
|
1673
|
+
}
|
|
1674
|
+
function toEndVisit(visitFunction) {
|
|
1675
|
+
return visitFunction ? () => {
|
|
1676
|
+
if (suppressedCallbacks > 0) {
|
|
1677
|
+
suppressedCallbacks--;
|
|
1678
|
+
}
|
|
1679
|
+
if (suppressedCallbacks === 0) {
|
|
1680
|
+
visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
|
|
1681
|
+
}
|
|
1682
|
+
} : () => true;
|
|
1683
|
+
}
|
|
1684
|
+
const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
|
|
1685
|
+
const disallowComments = options && options.disallowComments;
|
|
1686
|
+
const allowTrailingComma = options && options.allowTrailingComma;
|
|
1687
|
+
function scanNext() {
|
|
1688
|
+
while (true) {
|
|
1689
|
+
const token = _scanner.scan();
|
|
1690
|
+
switch (_scanner.getTokenError()) {
|
|
1691
|
+
case 4:
|
|
1692
|
+
handleError(14);
|
|
1693
|
+
break;
|
|
1694
|
+
case 5:
|
|
1695
|
+
handleError(15);
|
|
1696
|
+
break;
|
|
1697
|
+
case 3:
|
|
1698
|
+
handleError(13);
|
|
1699
|
+
break;
|
|
1700
|
+
case 1:
|
|
1701
|
+
if (!disallowComments) {
|
|
1702
|
+
handleError(11);
|
|
1703
|
+
}
|
|
1704
|
+
break;
|
|
1705
|
+
case 2:
|
|
1706
|
+
handleError(12);
|
|
1707
|
+
break;
|
|
1708
|
+
case 6:
|
|
1709
|
+
handleError(16);
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1712
|
+
switch (token) {
|
|
1713
|
+
case 12:
|
|
1714
|
+
case 13:
|
|
1715
|
+
if (disallowComments) {
|
|
1716
|
+
handleError(10);
|
|
1717
|
+
} else {
|
|
1718
|
+
onComment();
|
|
1719
|
+
}
|
|
1720
|
+
break;
|
|
1721
|
+
case 16:
|
|
1722
|
+
handleError(1);
|
|
1723
|
+
break;
|
|
1724
|
+
case 15:
|
|
1725
|
+
case 14:
|
|
1726
|
+
break;
|
|
1727
|
+
default:
|
|
1728
|
+
return token;
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
function handleError(error, skipUntilAfter = [], skipUntil = []) {
|
|
1733
|
+
onError(error);
|
|
1734
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
1735
|
+
let token = _scanner.getToken();
|
|
1736
|
+
while (token !== 17) {
|
|
1737
|
+
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
1738
|
+
scanNext();
|
|
1739
|
+
break;
|
|
1740
|
+
} else if (skipUntil.indexOf(token) !== -1) {
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
token = scanNext();
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
function parseString(isValue) {
|
|
1748
|
+
const value = _scanner.getTokenValue();
|
|
1749
|
+
if (isValue) {
|
|
1750
|
+
onLiteralValue(value);
|
|
1751
|
+
} else {
|
|
1752
|
+
onObjectProperty(value);
|
|
1753
|
+
_jsonPath.push(value);
|
|
1754
|
+
}
|
|
1755
|
+
scanNext();
|
|
1756
|
+
return true;
|
|
1757
|
+
}
|
|
1758
|
+
function parseLiteral() {
|
|
1759
|
+
switch (_scanner.getToken()) {
|
|
1760
|
+
case 11:
|
|
1761
|
+
const tokenValue = _scanner.getTokenValue();
|
|
1762
|
+
let value = Number(tokenValue);
|
|
1763
|
+
if (isNaN(value)) {
|
|
1764
|
+
handleError(2);
|
|
1765
|
+
value = 0;
|
|
1766
|
+
}
|
|
1767
|
+
onLiteralValue(value);
|
|
1768
|
+
break;
|
|
1769
|
+
case 7:
|
|
1770
|
+
onLiteralValue(null);
|
|
1771
|
+
break;
|
|
1772
|
+
case 8:
|
|
1773
|
+
onLiteralValue(true);
|
|
1774
|
+
break;
|
|
1775
|
+
case 9:
|
|
1776
|
+
onLiteralValue(false);
|
|
1777
|
+
break;
|
|
1778
|
+
default:
|
|
1779
|
+
return false;
|
|
1780
|
+
}
|
|
1781
|
+
scanNext();
|
|
1782
|
+
return true;
|
|
1783
|
+
}
|
|
1784
|
+
function parseProperty() {
|
|
1785
|
+
if (_scanner.getToken() !== 10) {
|
|
1786
|
+
handleError(3, [], [2, 5]);
|
|
1787
|
+
return false;
|
|
1788
|
+
}
|
|
1789
|
+
parseString(false);
|
|
1790
|
+
if (_scanner.getToken() === 6) {
|
|
1791
|
+
onSeparator(":");
|
|
1792
|
+
scanNext();
|
|
1793
|
+
if (!parseValue()) {
|
|
1794
|
+
handleError(4, [], [2, 5]);
|
|
1795
|
+
}
|
|
1796
|
+
} else {
|
|
1797
|
+
handleError(5, [], [2, 5]);
|
|
1798
|
+
}
|
|
1799
|
+
_jsonPath.pop();
|
|
1800
|
+
return true;
|
|
1801
|
+
}
|
|
1802
|
+
function parseObject() {
|
|
1803
|
+
onObjectBegin();
|
|
1804
|
+
scanNext();
|
|
1805
|
+
let needsComma = false;
|
|
1806
|
+
while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
|
|
1807
|
+
if (_scanner.getToken() === 5) {
|
|
1808
|
+
if (!needsComma) {
|
|
1809
|
+
handleError(4, [], []);
|
|
1810
|
+
}
|
|
1811
|
+
onSeparator(",");
|
|
1812
|
+
scanNext();
|
|
1813
|
+
if (_scanner.getToken() === 2 && allowTrailingComma) {
|
|
1814
|
+
break;
|
|
1815
|
+
}
|
|
1816
|
+
} else if (needsComma) {
|
|
1817
|
+
handleError(6, [], []);
|
|
1818
|
+
}
|
|
1819
|
+
if (!parseProperty()) {
|
|
1820
|
+
handleError(4, [], [2, 5]);
|
|
1821
|
+
}
|
|
1822
|
+
needsComma = true;
|
|
1823
|
+
}
|
|
1824
|
+
onObjectEnd();
|
|
1825
|
+
if (_scanner.getToken() !== 2) {
|
|
1826
|
+
handleError(7, [2], []);
|
|
1827
|
+
} else {
|
|
1828
|
+
scanNext();
|
|
1829
|
+
}
|
|
1830
|
+
return true;
|
|
1831
|
+
}
|
|
1832
|
+
function parseArray() {
|
|
1833
|
+
onArrayBegin();
|
|
1834
|
+
scanNext();
|
|
1835
|
+
let isFirstElement = true;
|
|
1836
|
+
let needsComma = false;
|
|
1837
|
+
while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
|
|
1838
|
+
if (_scanner.getToken() === 5) {
|
|
1839
|
+
if (!needsComma) {
|
|
1840
|
+
handleError(4, [], []);
|
|
1841
|
+
}
|
|
1842
|
+
onSeparator(",");
|
|
1843
|
+
scanNext();
|
|
1844
|
+
if (_scanner.getToken() === 4 && allowTrailingComma) {
|
|
1845
|
+
break;
|
|
1846
|
+
}
|
|
1847
|
+
} else if (needsComma) {
|
|
1848
|
+
handleError(6, [], []);
|
|
1849
|
+
}
|
|
1850
|
+
if (isFirstElement) {
|
|
1851
|
+
_jsonPath.push(0);
|
|
1852
|
+
isFirstElement = false;
|
|
1853
|
+
} else {
|
|
1854
|
+
_jsonPath[_jsonPath.length - 1]++;
|
|
1855
|
+
}
|
|
1856
|
+
if (!parseValue()) {
|
|
1857
|
+
handleError(4, [], [4, 5]);
|
|
1858
|
+
}
|
|
1859
|
+
needsComma = true;
|
|
1860
|
+
}
|
|
1861
|
+
onArrayEnd();
|
|
1862
|
+
if (!isFirstElement) {
|
|
1863
|
+
_jsonPath.pop();
|
|
1864
|
+
}
|
|
1865
|
+
if (_scanner.getToken() !== 4) {
|
|
1866
|
+
handleError(8, [4], []);
|
|
1867
|
+
} else {
|
|
1868
|
+
scanNext();
|
|
1869
|
+
}
|
|
1870
|
+
return true;
|
|
1871
|
+
}
|
|
1872
|
+
function parseValue() {
|
|
1873
|
+
switch (_scanner.getToken()) {
|
|
1874
|
+
case 3:
|
|
1875
|
+
return parseArray();
|
|
1876
|
+
case 1:
|
|
1877
|
+
return parseObject();
|
|
1878
|
+
case 10:
|
|
1879
|
+
return parseString(true);
|
|
1880
|
+
default:
|
|
1881
|
+
return parseLiteral();
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
scanNext();
|
|
1885
|
+
if (_scanner.getToken() === 17) {
|
|
1886
|
+
if (options.allowEmptyContent) {
|
|
1887
|
+
return true;
|
|
1888
|
+
}
|
|
1889
|
+
handleError(4, [], []);
|
|
1890
|
+
return false;
|
|
1891
|
+
}
|
|
1892
|
+
if (!parseValue()) {
|
|
1893
|
+
handleError(4, [], []);
|
|
1894
|
+
return false;
|
|
1895
|
+
}
|
|
1896
|
+
if (_scanner.getToken() !== 17) {
|
|
1897
|
+
handleError(9, [], []);
|
|
1898
|
+
}
|
|
1899
|
+
return true;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
1903
|
+
var ScanError;
|
|
1904
|
+
(function(ScanError2) {
|
|
1905
|
+
ScanError2[ScanError2["None"] = 0] = "None";
|
|
1906
|
+
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
1907
|
+
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
1908
|
+
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
1909
|
+
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
1910
|
+
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
1911
|
+
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
1912
|
+
})(ScanError || (ScanError = {}));
|
|
1913
|
+
var SyntaxKind;
|
|
1914
|
+
(function(SyntaxKind2) {
|
|
1915
|
+
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
1916
|
+
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
1917
|
+
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
1918
|
+
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
1919
|
+
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
1920
|
+
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
1921
|
+
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
1922
|
+
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
1923
|
+
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
1924
|
+
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
1925
|
+
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
1926
|
+
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
1927
|
+
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
1928
|
+
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
1929
|
+
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
1930
|
+
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
1931
|
+
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
1932
|
+
})(SyntaxKind || (SyntaxKind = {}));
|
|
1933
|
+
var parse2 = parse;
|
|
1934
|
+
var ParseErrorCode;
|
|
1935
|
+
(function(ParseErrorCode2) {
|
|
1936
|
+
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
1937
|
+
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
1938
|
+
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
1939
|
+
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
1940
|
+
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
1941
|
+
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
1942
|
+
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
1943
|
+
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
1944
|
+
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
1945
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
1946
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
1947
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
1948
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
1949
|
+
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
1950
|
+
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
1951
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
1952
|
+
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
1953
|
+
function printParseErrorCode(code) {
|
|
1954
|
+
switch (code) {
|
|
1955
|
+
case 1:
|
|
1956
|
+
return "InvalidSymbol";
|
|
1957
|
+
case 2:
|
|
1958
|
+
return "InvalidNumberFormat";
|
|
1959
|
+
case 3:
|
|
1960
|
+
return "PropertyNameExpected";
|
|
1961
|
+
case 4:
|
|
1962
|
+
return "ValueExpected";
|
|
1963
|
+
case 5:
|
|
1964
|
+
return "ColonExpected";
|
|
1965
|
+
case 6:
|
|
1966
|
+
return "CommaExpected";
|
|
1967
|
+
case 7:
|
|
1968
|
+
return "CloseBraceExpected";
|
|
1969
|
+
case 8:
|
|
1970
|
+
return "CloseBracketExpected";
|
|
1971
|
+
case 9:
|
|
1972
|
+
return "EndOfFileExpected";
|
|
1973
|
+
case 10:
|
|
1974
|
+
return "InvalidCommentToken";
|
|
1975
|
+
case 11:
|
|
1976
|
+
return "UnexpectedEndOfComment";
|
|
1977
|
+
case 12:
|
|
1978
|
+
return "UnexpectedEndOfString";
|
|
1979
|
+
case 13:
|
|
1980
|
+
return "UnexpectedEndOfNumber";
|
|
1981
|
+
case 14:
|
|
1982
|
+
return "InvalidUnicode";
|
|
1983
|
+
case 15:
|
|
1984
|
+
return "InvalidEscapeCharacter";
|
|
1985
|
+
case 16:
|
|
1986
|
+
return "InvalidCharacter";
|
|
1987
|
+
}
|
|
1988
|
+
return "<unknown ParseErrorCode>";
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
// src/lenient-json.ts
|
|
1992
|
+
function parseLenientJsonObject(raw, options) {
|
|
1993
|
+
const source = raw.replace(/^\uFEFF/, "");
|
|
1994
|
+
const errors = [];
|
|
1995
|
+
let parsed = parse2(source, errors, {
|
|
1996
|
+
allowTrailingComma: true,
|
|
1997
|
+
disallowComments: false
|
|
1998
|
+
});
|
|
1999
|
+
if (errors.length > 0) {
|
|
2000
|
+
try {
|
|
2001
|
+
parsed = import_json5.parse(source);
|
|
2002
|
+
} catch {
|
|
2003
|
+
const first = errors[0];
|
|
2004
|
+
throw new Error(`Invalid ${options.label} at offset ${first.offset} (${printParseErrorCode(first.error)})`);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
2008
|
+
throw new Error(`Invalid ${options.label}: expected a top-level object`);
|
|
2009
|
+
}
|
|
2010
|
+
return parsed;
|
|
2011
|
+
}
|
|
2012
|
+
export {
|
|
2013
|
+
parseLenientJsonObject
|
|
2014
|
+
};
|