@storm-software/workspace-tools 1.119.0 → 1.121.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/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/declarations.d.ts +66 -0
- package/index.js +88 -1
- package/meta.json +1 -1
- package/package.json +4 -2
- package/packages/workspace-tools/src/base/typescript-library-generator.d.ts +2 -14
- package/packages/workspace-tools/src/generators/browser-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/generators/neutral-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/generators/node-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/plugins/typescript/project-config.d.ts +1 -1
- package/packages/workspace-tools/src/utils/index.d.ts +1 -0
- package/packages/workspace-tools/src/utils/project-tags.d.ts +30 -0
- package/src/generators/browser-library/generator.js +8 -2
- package/src/generators/neutral-library/schema.d.ts +1 -1
- package/src/generators/node-library/generator.js +3 -1
- package/src/plugins/rust/index.js +67 -15
- package/src/plugins/typescript/index.js +92 -17
- package/src/utils/create-cli-options.js +46 -0
- package/src/utils/index.js +85 -0
- package/src/utils/lock-file.js +149 -0
- package/src/utils/project-tags.js +109 -0
- package/src/utils/toml.js +2969 -0
|
@@ -0,0 +1,2969 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/workspace-tools/src/utils/toml.ts
|
|
20
|
+
var toml_exports = {};
|
|
21
|
+
__export(toml_exports, {
|
|
22
|
+
modifyCargoNestedTable: () => modifyCargoNestedTable,
|
|
23
|
+
modifyCargoTable: () => modifyCargoTable,
|
|
24
|
+
parseCargoToml: () => parseCargoToml,
|
|
25
|
+
parseCargoTomlWithTree: () => parseCargoTomlWithTree,
|
|
26
|
+
stringifyCargoToml: () => stringifyCargoToml
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(toml_exports);
|
|
29
|
+
|
|
30
|
+
// node_modules/.pnpm/@ltd+j-toml@1.38.0/node_modules/@ltd/j-toml/index.mjs
|
|
31
|
+
var version = "1.38.0";
|
|
32
|
+
var SyntaxError$1 = SyntaxError;
|
|
33
|
+
var RangeError$1 = RangeError;
|
|
34
|
+
var TypeError$1 = TypeError;
|
|
35
|
+
var Error$1 = { if: Error }.if;
|
|
36
|
+
var undefined$1 = void 0;
|
|
37
|
+
var BigInt$1 = typeof BigInt === "undefined" ? undefined$1 : BigInt;
|
|
38
|
+
var RegExp$1 = RegExp;
|
|
39
|
+
var WeakMap$1 = WeakMap;
|
|
40
|
+
var get = WeakMap.prototype.get;
|
|
41
|
+
var set = WeakMap.prototype.set;
|
|
42
|
+
var create$1 = Object.create;
|
|
43
|
+
var isSafeInteger = Number.isSafeInteger;
|
|
44
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
45
|
+
var freeze = Object.freeze;
|
|
46
|
+
var isPrototypeOf = Object.prototype.isPrototypeOf;
|
|
47
|
+
var NULL = (
|
|
48
|
+
/* j-globals: null.prototype (internal) */
|
|
49
|
+
Object.seal ? /* @__PURE__ */ Object.preventExtensions(/* @__PURE__ */ Object.create(null)) : null
|
|
50
|
+
);
|
|
51
|
+
var bind = Function.prototype.bind;
|
|
52
|
+
var test = RegExp.prototype.test;
|
|
53
|
+
var exec = RegExp.prototype.exec;
|
|
54
|
+
var apply$1 = Reflect.apply;
|
|
55
|
+
var Proxy$1 = Proxy;
|
|
56
|
+
var toStringTag = typeof Symbol === "undefined" ? undefined$1 : Symbol.toStringTag;
|
|
57
|
+
var Object_defineProperty = Object.defineProperty;
|
|
58
|
+
var assign$1 = Object.assign;
|
|
59
|
+
var Object$1 = Object;
|
|
60
|
+
var floor = Math.floor;
|
|
61
|
+
var isArray$1 = Array.isArray;
|
|
62
|
+
var Infinity = 1 / 0;
|
|
63
|
+
var fromCharCode = String.fromCharCode;
|
|
64
|
+
var Array$1 = Array;
|
|
65
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
66
|
+
var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
67
|
+
var apply = Function.prototype.apply;
|
|
68
|
+
var isEnum = /* @__PURE__ */ propertyIsEnumerable.call.bind(propertyIsEnumerable);
|
|
69
|
+
var hasOwn = (
|
|
70
|
+
/* j-globals: Object.hasOwn (polyfill) */
|
|
71
|
+
Object$1.hasOwn || /* @__PURE__ */ function() {
|
|
72
|
+
return hasOwnProperty.bind ? hasOwnProperty.call.bind(hasOwnProperty) : function hasOwn2(object, key) {
|
|
73
|
+
return hasOwnProperty.call(object, key);
|
|
74
|
+
};
|
|
75
|
+
}()
|
|
76
|
+
);
|
|
77
|
+
var create = Object$1.create;
|
|
78
|
+
function Descriptor(source) {
|
|
79
|
+
var target = create(NULL);
|
|
80
|
+
if (hasOwn(source, "value")) {
|
|
81
|
+
target.value = source.value;
|
|
82
|
+
}
|
|
83
|
+
if (hasOwn(source, "writable")) {
|
|
84
|
+
target.writable = source.writable;
|
|
85
|
+
}
|
|
86
|
+
if (hasOwn(source, "get")) {
|
|
87
|
+
target.get = source.get;
|
|
88
|
+
}
|
|
89
|
+
if (hasOwn(source, "set")) {
|
|
90
|
+
target.set = source.set;
|
|
91
|
+
}
|
|
92
|
+
if (hasOwn(source, "enumerable")) {
|
|
93
|
+
target.enumerable = source.enumerable;
|
|
94
|
+
}
|
|
95
|
+
if (hasOwn(source, "configurable")) {
|
|
96
|
+
target.configurable = source.configurable;
|
|
97
|
+
}
|
|
98
|
+
return target;
|
|
99
|
+
}
|
|
100
|
+
var Default = (
|
|
101
|
+
/* j-globals: default (internal) */
|
|
102
|
+
function Default2(exports2, addOnOrigin) {
|
|
103
|
+
if (!addOnOrigin && typeof exports2 !== "function") {
|
|
104
|
+
addOnOrigin = exports2;
|
|
105
|
+
exports2 = create$1(NULL);
|
|
106
|
+
}
|
|
107
|
+
if (assign$1) {
|
|
108
|
+
assign$1(exports2, addOnOrigin);
|
|
109
|
+
} else {
|
|
110
|
+
for (var key in addOnOrigin) {
|
|
111
|
+
if (hasOwn(addOnOrigin, key)) {
|
|
112
|
+
exports2[key] = addOnOrigin[key];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports2.default = exports2;
|
|
117
|
+
if (typeof exports2 === "function") {
|
|
118
|
+
exports2.prototype && freeze(exports2.prototype);
|
|
119
|
+
} else if (toStringTag) {
|
|
120
|
+
var descriptor = create$1(NULL);
|
|
121
|
+
descriptor.value = "Module";
|
|
122
|
+
Object_defineProperty(exports2, toStringTag, descriptor);
|
|
123
|
+
}
|
|
124
|
+
return freeze(exports2);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
var Test = bind ? /* @__PURE__ */ bind.bind(test) : function(re) {
|
|
128
|
+
return function(string) {
|
|
129
|
+
return test.call(re, string);
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
var Exec = bind ? /* @__PURE__ */ bind.bind(exec) : function(re) {
|
|
133
|
+
return function(string) {
|
|
134
|
+
return exec.call(re, string);
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
function __PURE__(re) {
|
|
138
|
+
var test2 = re.test = Test(re);
|
|
139
|
+
var exec2 = re.exec = Exec(re);
|
|
140
|
+
var source = test2.source = exec2.source = re.source;
|
|
141
|
+
test2.unicode = exec2.unicode = re.unicode;
|
|
142
|
+
test2.ignoreCase = exec2.ignoreCase = re.ignoreCase;
|
|
143
|
+
test2.multiline = exec2.multiline = source.indexOf("^") < 0 && source.indexOf("$") < 0 ? null : re.multiline;
|
|
144
|
+
test2.dotAll = exec2.dotAll = source.indexOf(".") < 0 ? null : re.dotAll;
|
|
145
|
+
return re;
|
|
146
|
+
}
|
|
147
|
+
function theRegExp(re) {
|
|
148
|
+
return /* @__PURE__ */ __PURE__(re);
|
|
149
|
+
}
|
|
150
|
+
var NT = /[\n\t]+/g;
|
|
151
|
+
var ESCAPE = /\\./g;
|
|
152
|
+
function graveAccentReplacer($$) {
|
|
153
|
+
return $$ === "\\`" ? "`" : $$;
|
|
154
|
+
}
|
|
155
|
+
var includes = "".includes ? function(that, searchString) {
|
|
156
|
+
return that.includes(searchString);
|
|
157
|
+
} : function(that, searchString) {
|
|
158
|
+
return that.indexOf(searchString) > -1;
|
|
159
|
+
};
|
|
160
|
+
function RE(template) {
|
|
161
|
+
var U = this.U;
|
|
162
|
+
var I = this.I;
|
|
163
|
+
var M = this.M;
|
|
164
|
+
var S = this.S;
|
|
165
|
+
var raw = template.raw;
|
|
166
|
+
var source = raw[0].replace(NT, "");
|
|
167
|
+
var index = 1;
|
|
168
|
+
var length = arguments.length;
|
|
169
|
+
while (index !== length) {
|
|
170
|
+
var value = arguments[index];
|
|
171
|
+
if (typeof value === "string") {
|
|
172
|
+
source += value;
|
|
173
|
+
} else {
|
|
174
|
+
var value_source = value.source;
|
|
175
|
+
if (typeof value_source !== "string") {
|
|
176
|
+
throw TypeError$1("source");
|
|
177
|
+
}
|
|
178
|
+
if (value.unicode === U) {
|
|
179
|
+
throw SyntaxError$1("unicode");
|
|
180
|
+
}
|
|
181
|
+
if (value.ignoreCase === I) {
|
|
182
|
+
throw SyntaxError$1("ignoreCase");
|
|
183
|
+
}
|
|
184
|
+
if (value.multiline === M && (includes(value_source, "^") || includes(value_source, "$"))) {
|
|
185
|
+
throw SyntaxError$1("multiline");
|
|
186
|
+
}
|
|
187
|
+
if (value.dotAll === S && includes(value_source, ".")) {
|
|
188
|
+
throw SyntaxError$1("dotAll");
|
|
189
|
+
}
|
|
190
|
+
source += value_source;
|
|
191
|
+
}
|
|
192
|
+
source += raw[index++].replace(NT, "");
|
|
193
|
+
}
|
|
194
|
+
var re = RegExp$1(U ? source = source.replace(ESCAPE, graveAccentReplacer) : source, this.flags);
|
|
195
|
+
var test2 = re.test = Test(re);
|
|
196
|
+
var exec2 = re.exec = Exec(re);
|
|
197
|
+
test2.source = exec2.source = source;
|
|
198
|
+
test2.unicode = exec2.unicode = !U;
|
|
199
|
+
test2.ignoreCase = exec2.ignoreCase = !I;
|
|
200
|
+
test2.multiline = exec2.multiline = includes(source, "^") || includes(source, "$") ? !M : null;
|
|
201
|
+
test2.dotAll = exec2.dotAll = includes(source, ".") ? !S : null;
|
|
202
|
+
return re;
|
|
203
|
+
}
|
|
204
|
+
var RE_bind = bind && /* @__PURE__ */ bind.bind(RE);
|
|
205
|
+
function Context(flags) {
|
|
206
|
+
return {
|
|
207
|
+
U: !includes(flags, "u"),
|
|
208
|
+
I: !includes(flags, "i"),
|
|
209
|
+
M: !includes(flags, "m"),
|
|
210
|
+
S: !includes(flags, "s"),
|
|
211
|
+
flags
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
var CONTEXT = /* @__PURE__ */ Context("");
|
|
215
|
+
var newRegExp = Proxy$1 ? /* @__PURE__ */ new Proxy$1(RE, {
|
|
216
|
+
apply: function(RE2, thisArg, args) {
|
|
217
|
+
return apply$1(RE2, CONTEXT, args);
|
|
218
|
+
},
|
|
219
|
+
get: function(RE2, flags) {
|
|
220
|
+
return RE_bind(Context(flags));
|
|
221
|
+
},
|
|
222
|
+
defineProperty: function() {
|
|
223
|
+
return false;
|
|
224
|
+
},
|
|
225
|
+
preventExtensions: function() {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}) : /* @__PURE__ */ function() {
|
|
229
|
+
RE.apply = RE.apply;
|
|
230
|
+
var newRegExp2 = function() {
|
|
231
|
+
return RE.apply(CONTEXT, arguments);
|
|
232
|
+
};
|
|
233
|
+
var d2 = 1;
|
|
234
|
+
var g = d2 * 2;
|
|
235
|
+
var i = g * 2;
|
|
236
|
+
var m = i * 2;
|
|
237
|
+
var s = i * 2;
|
|
238
|
+
var u = s * 2;
|
|
239
|
+
var y = u * 2;
|
|
240
|
+
var flags = y * 2 - 1;
|
|
241
|
+
while (flags--) {
|
|
242
|
+
(function(context) {
|
|
243
|
+
newRegExp2[context.flags] = function() {
|
|
244
|
+
return RE.apply(context, arguments);
|
|
245
|
+
};
|
|
246
|
+
})(Context(
|
|
247
|
+
(flags & d2 ? "" : "d") + (flags & g ? "" : "g") + (flags & i ? "" : "i") + (flags & m ? "" : "m") + (flags & s ? "" : "s") + (flags & u ? "" : "u") + (flags & y ? "" : "y")
|
|
248
|
+
));
|
|
249
|
+
}
|
|
250
|
+
return freeze ? freeze(newRegExp2) : newRegExp2;
|
|
251
|
+
}();
|
|
252
|
+
var clearRegExp = "$_" in RegExp$1 ? /* @__PURE__ */ function() {
|
|
253
|
+
var REGEXP = /^/;
|
|
254
|
+
REGEXP.test = REGEXP.test;
|
|
255
|
+
return function clearRegExp3(value) {
|
|
256
|
+
REGEXP.test("");
|
|
257
|
+
return value;
|
|
258
|
+
};
|
|
259
|
+
}() : function clearRegExp2(value) {
|
|
260
|
+
return value;
|
|
261
|
+
};
|
|
262
|
+
var clearRegExp$1 = clearRegExp;
|
|
263
|
+
var NEED_TO_ESCAPE_IN_REGEXP = /^[$()*+\-.?[\\\]^{|]/;
|
|
264
|
+
var SURROGATE_PAIR = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/;
|
|
265
|
+
var GROUP = /* @__PURE__ */ create$1(NULL);
|
|
266
|
+
function groupify(branches, uFlag, noEscape) {
|
|
267
|
+
var group = create$1(NULL);
|
|
268
|
+
var appendBranch = uFlag ? appendPointBranch : appendCodeBranch;
|
|
269
|
+
for (var length = branches.length, index = 0; index < length; ++index) {
|
|
270
|
+
appendBranch(group, branches[index]);
|
|
271
|
+
}
|
|
272
|
+
return sourcify(group, !noEscape);
|
|
273
|
+
}
|
|
274
|
+
function appendPointBranch(group, branch) {
|
|
275
|
+
if (branch) {
|
|
276
|
+
var character = SURROGATE_PAIR.test(branch) ? branch.slice(0, 2) : branch.charAt(0);
|
|
277
|
+
appendPointBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(character.length));
|
|
278
|
+
} else {
|
|
279
|
+
group[""] = GROUP;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function appendCodeBranch(group, branch) {
|
|
283
|
+
if (branch) {
|
|
284
|
+
var character = branch.charAt(0);
|
|
285
|
+
appendCodeBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(1));
|
|
286
|
+
} else {
|
|
287
|
+
group[""] = GROUP;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function sourcify(group, needEscape) {
|
|
291
|
+
var branches = [];
|
|
292
|
+
var singleCharactersBranch = [];
|
|
293
|
+
var noEmptyBranch = true;
|
|
294
|
+
for (var character in group) {
|
|
295
|
+
if (character) {
|
|
296
|
+
var sub_branches = sourcify(group[character], needEscape);
|
|
297
|
+
if (needEscape && NEED_TO_ESCAPE_IN_REGEXP.test(character)) {
|
|
298
|
+
character = "\\" + character;
|
|
299
|
+
}
|
|
300
|
+
sub_branches ? branches.push(character + sub_branches) : singleCharactersBranch.push(character);
|
|
301
|
+
} else {
|
|
302
|
+
noEmptyBranch = false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
singleCharactersBranch.length && branches.unshift(singleCharactersBranch.length === 1 ? singleCharactersBranch[0] : "[" + singleCharactersBranch.join("") + "]");
|
|
306
|
+
return branches.length === 0 ? "" : (branches.length === 1 && (singleCharactersBranch.length || noEmptyBranch) ? branches[0] : "(?:" + branches.join("|") + ")") + (noEmptyBranch ? "" : "?");
|
|
307
|
+
}
|
|
308
|
+
var WeakSet$1 = WeakSet;
|
|
309
|
+
var has = WeakSet.prototype.has;
|
|
310
|
+
var add = WeakSet.prototype.add;
|
|
311
|
+
var del = WeakSet.prototype["delete"];
|
|
312
|
+
var keys = Object.keys;
|
|
313
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
314
|
+
var Null$1 = (
|
|
315
|
+
/* j-globals: null (internal) */
|
|
316
|
+
/* @__PURE__ */ function() {
|
|
317
|
+
var assign2 = Object.assign || function assign3(target, source) {
|
|
318
|
+
var keys$1, index, key;
|
|
319
|
+
for (keys$1 = keys(source), index = 0; index < keys$1.length; ++index) {
|
|
320
|
+
key = keys$1[index];
|
|
321
|
+
target[key] = source[key];
|
|
322
|
+
}
|
|
323
|
+
if (getOwnPropertySymbols) {
|
|
324
|
+
for (keys$1 = getOwnPropertySymbols(source), index = 0; index < keys$1.length; ++index) {
|
|
325
|
+
key = keys$1[index];
|
|
326
|
+
if (isEnum(source, key)) {
|
|
327
|
+
target[key] = source[key];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return target;
|
|
332
|
+
};
|
|
333
|
+
function Nullify(constructor) {
|
|
334
|
+
delete constructor.prototype.constructor;
|
|
335
|
+
freeze(constructor.prototype);
|
|
336
|
+
return constructor;
|
|
337
|
+
}
|
|
338
|
+
function Null2(origin) {
|
|
339
|
+
return origin === undefined$1 ? this : typeof origin === "function" ? /* @__PURE__ */ Nullify(origin) : /* @__PURE__ */ assign2(/* @__PURE__ */ create(NULL), origin);
|
|
340
|
+
}
|
|
341
|
+
delete Null2.name;
|
|
342
|
+
Null2.prototype = null;
|
|
343
|
+
freeze(Null2);
|
|
344
|
+
return Null2;
|
|
345
|
+
}()
|
|
346
|
+
);
|
|
347
|
+
var is = Object.is;
|
|
348
|
+
var Object_defineProperties = Object.defineProperties;
|
|
349
|
+
var fromEntries = Object.fromEntries;
|
|
350
|
+
var Reflect_construct = Reflect.construct;
|
|
351
|
+
var Reflect_defineProperty = Reflect.defineProperty;
|
|
352
|
+
var Reflect_deleteProperty = Reflect.deleteProperty;
|
|
353
|
+
var ownKeys = Reflect.ownKeys;
|
|
354
|
+
var Keeper = () => [];
|
|
355
|
+
var newWeakMap = () => {
|
|
356
|
+
const weakMap = new WeakMap$1();
|
|
357
|
+
weakMap.has = weakMap.has;
|
|
358
|
+
weakMap.get = weakMap.get;
|
|
359
|
+
weakMap.set = weakMap.set;
|
|
360
|
+
return weakMap;
|
|
361
|
+
};
|
|
362
|
+
var target2keeper = /* @__PURE__ */ newWeakMap();
|
|
363
|
+
var proxy2target = /* @__PURE__ */ newWeakMap();
|
|
364
|
+
var target2proxy = /* @__PURE__ */ newWeakMap();
|
|
365
|
+
var handlers = /* @__PURE__ */ assign$1(create$1(NULL), {
|
|
366
|
+
defineProperty: (target, key, descriptor) => {
|
|
367
|
+
if (hasOwn(target, key)) {
|
|
368
|
+
return Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor));
|
|
369
|
+
}
|
|
370
|
+
if (Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor))) {
|
|
371
|
+
const keeper = target2keeper.get(target);
|
|
372
|
+
keeper[keeper.length] = key;
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
return false;
|
|
376
|
+
},
|
|
377
|
+
deleteProperty: (target, key) => {
|
|
378
|
+
if (Reflect_deleteProperty(target, key)) {
|
|
379
|
+
const keeper = target2keeper.get(target);
|
|
380
|
+
const index = keeper.indexOf(key);
|
|
381
|
+
index < 0 || --keeper.copyWithin(index, index + 1).length;
|
|
382
|
+
return true;
|
|
383
|
+
}
|
|
384
|
+
return false;
|
|
385
|
+
},
|
|
386
|
+
ownKeys: (target) => target2keeper.get(target),
|
|
387
|
+
construct: (target, args, newTarget) => orderify(Reflect_construct(target, args, newTarget)),
|
|
388
|
+
apply: (target, thisArg, args) => orderify(apply$1(target, thisArg, args))
|
|
389
|
+
});
|
|
390
|
+
var newProxy = (target, keeper) => {
|
|
391
|
+
target2keeper.set(target, keeper);
|
|
392
|
+
const proxy = new Proxy$1(target, handlers);
|
|
393
|
+
proxy2target.set(proxy, target);
|
|
394
|
+
return proxy;
|
|
395
|
+
};
|
|
396
|
+
var orderify = (object) => {
|
|
397
|
+
if (proxy2target.has(object)) {
|
|
398
|
+
return object;
|
|
399
|
+
}
|
|
400
|
+
let proxy = target2proxy.get(object);
|
|
401
|
+
if (proxy) {
|
|
402
|
+
return proxy;
|
|
403
|
+
}
|
|
404
|
+
proxy = newProxy(object, assign$1(Keeper(), ownKeys(object)));
|
|
405
|
+
target2proxy.set(object, proxy);
|
|
406
|
+
return proxy;
|
|
407
|
+
};
|
|
408
|
+
var Null = /* @__PURE__ */ function() {
|
|
409
|
+
function throwConstructing() {
|
|
410
|
+
throw TypeError$1(`Super constructor Null cannot be invoked with 'new'`);
|
|
411
|
+
}
|
|
412
|
+
function throwApplying() {
|
|
413
|
+
throw TypeError$1(`Super constructor Null cannot be invoked without 'new'`);
|
|
414
|
+
}
|
|
415
|
+
const Nullify = (constructor) => {
|
|
416
|
+
delete constructor.prototype.constructor;
|
|
417
|
+
freeze(constructor.prototype);
|
|
418
|
+
return constructor;
|
|
419
|
+
};
|
|
420
|
+
function Null2(constructor) {
|
|
421
|
+
return new.target ? new.target === Null2 ? /* @__PURE__ */ throwConstructing() : /* @__PURE__ */ newProxy(this, Keeper()) : typeof constructor === "function" ? /* @__PURE__ */ Nullify(constructor) : /* @__PURE__ */ throwApplying();
|
|
422
|
+
}
|
|
423
|
+
Null2.prototype = null;
|
|
424
|
+
Object_defineProperty(Null2, "name", assign$1(create$1(NULL), { value: "", configurable: false }));
|
|
425
|
+
freeze(Null2);
|
|
426
|
+
return Null2;
|
|
427
|
+
}();
|
|
428
|
+
var map_has = WeakMap.prototype.has;
|
|
429
|
+
var map_del = WeakMap.prototype["delete"];
|
|
430
|
+
var INLINES = new WeakMap$1();
|
|
431
|
+
var SECTIONS = new WeakSet$1();
|
|
432
|
+
var deInline = /* @__PURE__ */ map_del.bind(INLINES);
|
|
433
|
+
var deSection = /* @__PURE__ */ del.bind(SECTIONS);
|
|
434
|
+
var isInline = /* @__PURE__ */ map_has.bind(INLINES);
|
|
435
|
+
var ofInline = /* @__PURE__ */ get.bind(INLINES);
|
|
436
|
+
var beInline = /* @__PURE__ */ set.bind(INLINES);
|
|
437
|
+
var inline = (value, mode, looping) => {
|
|
438
|
+
if (isArray$1(value)) {
|
|
439
|
+
if (looping) {
|
|
440
|
+
mode = 3;
|
|
441
|
+
} else {
|
|
442
|
+
if (mode === undefined$1) {
|
|
443
|
+
mode = 3;
|
|
444
|
+
} else if (mode !== 0 && mode !== 1 && mode !== 2 && mode !== 3) {
|
|
445
|
+
throw typeof mode === "number" ? RangeError$1(`array inline mode must be 0 | 1 | 2 | 3, not including ${mode}`) : TypeError$1(`array inline mode must be "number" type, not including ${mode === null ? '"null"' : typeof mode}`);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
beInline(value, mode);
|
|
449
|
+
} else {
|
|
450
|
+
beInline(value, true);
|
|
451
|
+
deSection(value);
|
|
452
|
+
}
|
|
453
|
+
return value;
|
|
454
|
+
};
|
|
455
|
+
var multilineTable = (value) => {
|
|
456
|
+
beInline(value, false);
|
|
457
|
+
deSection(value);
|
|
458
|
+
return value;
|
|
459
|
+
};
|
|
460
|
+
var multilineArray = (value) => {
|
|
461
|
+
deInline(value);
|
|
462
|
+
return value;
|
|
463
|
+
};
|
|
464
|
+
var isSection = /* @__PURE__ */ has.bind(SECTIONS);
|
|
465
|
+
var beSection = /* @__PURE__ */ add.bind(SECTIONS);
|
|
466
|
+
var Section = (table) => {
|
|
467
|
+
if (isArray$1(table)) {
|
|
468
|
+
throw TypeError$1(`array can not be section, maybe you want to use it on the tables in it`);
|
|
469
|
+
}
|
|
470
|
+
beSection(table);
|
|
471
|
+
deInline(table);
|
|
472
|
+
return table;
|
|
473
|
+
};
|
|
474
|
+
var INLINE = true;
|
|
475
|
+
var tables = new WeakSet$1();
|
|
476
|
+
var tables_add = /* @__PURE__ */ add.bind(tables);
|
|
477
|
+
var isTable = /* @__PURE__ */ has.bind(tables);
|
|
478
|
+
var implicitTables = new WeakSet$1();
|
|
479
|
+
var implicitTables_add = /* @__PURE__ */ add.bind(implicitTables);
|
|
480
|
+
var implicitTables_del = /* @__PURE__ */ del.bind(implicitTables);
|
|
481
|
+
var directlyIfNot = (table) => {
|
|
482
|
+
if (implicitTables_del(table)) {
|
|
483
|
+
beSection(table);
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
return false;
|
|
487
|
+
};
|
|
488
|
+
var DIRECTLY = true;
|
|
489
|
+
var IMPLICITLY = false;
|
|
490
|
+
var pairs = new WeakSet$1();
|
|
491
|
+
var pairs_add = /* @__PURE__ */ add.bind(pairs);
|
|
492
|
+
var fromPair = /* @__PURE__ */ has.bind(pairs);
|
|
493
|
+
var PAIR = true;
|
|
494
|
+
var PlainTable = /* @__PURE__ */ Null$1(class Table extends Null$1 {
|
|
495
|
+
constructor(isDirect, isInline$fromPair) {
|
|
496
|
+
super();
|
|
497
|
+
tables_add(this);
|
|
498
|
+
isDirect ? isInline$fromPair ? beInline(this, true) : beSection(this) : (isInline$fromPair ? pairs_add : implicitTables_add)(this);
|
|
499
|
+
return this;
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
var OrderedTable = /* @__PURE__ */ Null$1(class Table2 extends Null {
|
|
503
|
+
constructor(isDirect, isInline$fromPair) {
|
|
504
|
+
super();
|
|
505
|
+
tables_add(this);
|
|
506
|
+
isDirect ? isInline$fromPair ? beInline(this, true) : beSection(this) : (isInline$fromPair ? pairs_add : implicitTables_add)(this);
|
|
507
|
+
return this;
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
var NONE = [];
|
|
511
|
+
var sourcePath = "";
|
|
512
|
+
var sourceLines = NONE;
|
|
513
|
+
var lastLineIndex = -1;
|
|
514
|
+
var lineIndex = -1;
|
|
515
|
+
var throws = (error) => {
|
|
516
|
+
throw error;
|
|
517
|
+
};
|
|
518
|
+
var EOL = /\r?\n/;
|
|
519
|
+
var todo = (source, path) => {
|
|
520
|
+
if (typeof path !== "string") {
|
|
521
|
+
throw TypeError$1(`TOML.parse({ path })`);
|
|
522
|
+
}
|
|
523
|
+
sourcePath = path;
|
|
524
|
+
sourceLines = source.split(EOL);
|
|
525
|
+
lastLineIndex = sourceLines.length - 1;
|
|
526
|
+
lineIndex = -1;
|
|
527
|
+
};
|
|
528
|
+
var next = () => sourceLines[++lineIndex];
|
|
529
|
+
var rest = () => lineIndex !== lastLineIndex;
|
|
530
|
+
var mark = class {
|
|
531
|
+
lineIndex = lineIndex;
|
|
532
|
+
type;
|
|
533
|
+
restColumn;
|
|
534
|
+
constructor(type, restColumn) {
|
|
535
|
+
this.type = type;
|
|
536
|
+
this.restColumn = restColumn;
|
|
537
|
+
return this;
|
|
538
|
+
}
|
|
539
|
+
must() {
|
|
540
|
+
lineIndex === lastLineIndex && throws(SyntaxError$1(`${this.type} is not close until the end of the file` + where(", which started from ", this.lineIndex, sourceLines[this.lineIndex].length - this.restColumn + 1)));
|
|
541
|
+
return sourceLines[++lineIndex];
|
|
542
|
+
}
|
|
543
|
+
nowrap(argsMode) {
|
|
544
|
+
throw throws(Error$1(`TOML.parse(${argsMode ? `${argsMode}multilineStringJoiner` : `,{ joiner }`}) must be passed, while the source including multi-line string` + where(", which started from ", this.lineIndex, sourceLines[this.lineIndex].length - this.restColumn + 1)));
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
var where = (pre, rowIndex = lineIndex, columnNumber = 0) => sourceLines === NONE ? "" : sourcePath ? `
|
|
548
|
+
at (${sourcePath}:${rowIndex + 1}:${columnNumber})` : `${pre}line ${rowIndex + 1}: ${sourceLines[rowIndex]}`;
|
|
549
|
+
var done = () => {
|
|
550
|
+
sourcePath = "";
|
|
551
|
+
sourceLines = NONE;
|
|
552
|
+
};
|
|
553
|
+
var Whitespace = /[ \t]/;
|
|
554
|
+
var PRE_WHITESPACE = /* @__PURE__ */ newRegExp`
|
|
555
|
+
^${Whitespace}+`.valueOf();
|
|
556
|
+
var { exec: VALUE_REST_exec } = /* @__PURE__ */ newRegExp.s`
|
|
557
|
+
^
|
|
558
|
+
(
|
|
559
|
+
(?:\d\d\d\d-\d\d-\d\d \d)?
|
|
560
|
+
[\w\-+.:]+
|
|
561
|
+
)
|
|
562
|
+
${Whitespace}*
|
|
563
|
+
(.*)
|
|
564
|
+
$`.valueOf();
|
|
565
|
+
var { exec: LITERAL_STRING_exec } = /* @__PURE__ */ newRegExp.s`
|
|
566
|
+
^
|
|
567
|
+
'([^']*)'
|
|
568
|
+
${Whitespace}*
|
|
569
|
+
(.*)`.valueOf();
|
|
570
|
+
var { exec: MULTI_LINE_LITERAL_STRING_0_1_2 } = /* @__PURE__ */ newRegExp.s`
|
|
571
|
+
^
|
|
572
|
+
(.*?)
|
|
573
|
+
'''('{0,2})
|
|
574
|
+
${Whitespace}*
|
|
575
|
+
(.*)`.valueOf();
|
|
576
|
+
var { exec: MULTI_LINE_LITERAL_STRING_0 } = /* @__PURE__ */ newRegExp.s`
|
|
577
|
+
^
|
|
578
|
+
(.*?)
|
|
579
|
+
'''()
|
|
580
|
+
${Whitespace}*
|
|
581
|
+
(.*)`.valueOf();
|
|
582
|
+
var __MULTI_LINE_LITERAL_STRING_exec = MULTI_LINE_LITERAL_STRING_0;
|
|
583
|
+
var SYM_WHITESPACE = /* @__PURE__ */ newRegExp.s`
|
|
584
|
+
^
|
|
585
|
+
.
|
|
586
|
+
${Whitespace}*`.valueOf();
|
|
587
|
+
var Tag = /[^\x00-\x1F"#'()<>[\\\]`{}\x7F]+/;
|
|
588
|
+
var { exec: KEY_VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
|
|
589
|
+
^
|
|
590
|
+
${Whitespace}*
|
|
591
|
+
=
|
|
592
|
+
${Whitespace}*
|
|
593
|
+
(?:
|
|
594
|
+
<(${Tag})>
|
|
595
|
+
${Whitespace}*
|
|
596
|
+
)?
|
|
597
|
+
(.*)
|
|
598
|
+
$`.valueOf();
|
|
599
|
+
var { exec: _VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
|
|
600
|
+
^
|
|
601
|
+
<(${Tag})>
|
|
602
|
+
${Whitespace}*
|
|
603
|
+
(.*)
|
|
604
|
+
$`.valueOf();
|
|
605
|
+
var { exec: TAG_REST_exec } = /* @__PURE__ */ newRegExp.s`
|
|
606
|
+
^
|
|
607
|
+
<(${Tag})>
|
|
608
|
+
${Whitespace}*
|
|
609
|
+
(.*)
|
|
610
|
+
$`.valueOf();
|
|
611
|
+
var MULTI_LINE_BASIC_STRING = theRegExp(/[^\\"]+|\\.?|"(?!"")"?/sy);
|
|
612
|
+
var MULTI_LINE_BASIC_STRING_exec_0_length = (_) => {
|
|
613
|
+
let lastIndex = (
|
|
614
|
+
/*MULTI_LINE_BASIC_STRING.lastIndex = */
|
|
615
|
+
0
|
|
616
|
+
);
|
|
617
|
+
while (MULTI_LINE_BASIC_STRING.test(_)) {
|
|
618
|
+
lastIndex = MULTI_LINE_BASIC_STRING.lastIndex;
|
|
619
|
+
}
|
|
620
|
+
return lastIndex;
|
|
621
|
+
};
|
|
622
|
+
var ESCAPED_EXCLUDE_CONTROL_CHARACTER_TAB______ = /[^\\\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g;
|
|
623
|
+
var ESCAPED_EXCLUDE_CONTROL_CHARACTER__________ = /[^\\\x00-\x09\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g;
|
|
624
|
+
var ESCAPED_EXCLUDE_CONTROL_CHARACTER_DEL______ = /[^\\\x00-\x09\x0B-\x1F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g;
|
|
625
|
+
var ESCAPED_EXCLUDE_CONTROL_CHARACTER_DEL_SLASH = /[^\\\x00-\x09\x0B-\x1F]+|\\(?:[btnfr"\\/]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g;
|
|
626
|
+
var __ESCAPED_EXCLUDE_CONTROL_CHARACTER = ESCAPED_EXCLUDE_CONTROL_CHARACTER_TAB______;
|
|
627
|
+
var ESCAPED_EXCLUDE_CONTROL_CHARACTER_test = (_) => !_.replace(__ESCAPED_EXCLUDE_CONTROL_CHARACTER, "");
|
|
628
|
+
var BASIC_STRING_TAB______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
629
|
+
var BASIC_STRING__________ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
630
|
+
var BASIC_STRING_DEL______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
631
|
+
var BASIC_STRING_DEL_SLASH = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\/]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
632
|
+
var __BASIC_STRING = BASIC_STRING_DEL_SLASH;
|
|
633
|
+
var BASIC_STRING_exec_1_endIndex = (line) => {
|
|
634
|
+
let lastIndex = __BASIC_STRING.lastIndex = 1;
|
|
635
|
+
while (__BASIC_STRING.test(line)) {
|
|
636
|
+
lastIndex = __BASIC_STRING.lastIndex;
|
|
637
|
+
}
|
|
638
|
+
lastIndex !== line.length && line[lastIndex] === '"' || throws(SyntaxError$1(`Bad basic string` + where(" at ")));
|
|
639
|
+
return lastIndex;
|
|
640
|
+
};
|
|
641
|
+
var { test: IS_DOT_KEY } = theRegExp(/^[ \t]*\./);
|
|
642
|
+
var DOT_KEY = /^[ \t]*\.[ \t]*/;
|
|
643
|
+
var { exec: BARE_KEY_STRICT } = theRegExp(/^[\w-]+/);
|
|
644
|
+
var { exec: BARE_KEY_FREE } = theRegExp(/^[^ \t#=[\]'".]+(?:[ \t]+[^ \t#=[\]'".]+)*/);
|
|
645
|
+
var __BARE_KEY_exec = BARE_KEY_FREE;
|
|
646
|
+
var { exec: LITERAL_KEY____ } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F\x7F]*'/);
|
|
647
|
+
var { exec: LITERAL_KEY_DEL } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F]*'/);
|
|
648
|
+
var __LITERAL_KEY_exec = LITERAL_KEY_DEL;
|
|
649
|
+
var supportArrayOfTables = true;
|
|
650
|
+
var TABLE_DEFINITION_exec_groups = (lineRest, parseKeys2) => {
|
|
651
|
+
const asArrayItem = lineRest[1] === "[";
|
|
652
|
+
if (asArrayItem) {
|
|
653
|
+
supportArrayOfTables || throws(SyntaxError$1(`Array of Tables is not allowed before TOML v0.2` + where(", which at ")));
|
|
654
|
+
lineRest = lineRest.slice(2);
|
|
655
|
+
} else {
|
|
656
|
+
lineRest = lineRest.slice(1);
|
|
657
|
+
}
|
|
658
|
+
lineRest = lineRest.replace(PRE_WHITESPACE, "");
|
|
659
|
+
const { leadingKeys, finalKey } = { lineRest } = parseKeys2(lineRest);
|
|
660
|
+
lineRest = lineRest.replace(PRE_WHITESPACE, "");
|
|
661
|
+
lineRest && lineRest[0] === "]" || throws(SyntaxError$1(`Table header is not closed` + where(", which is found at ")));
|
|
662
|
+
(lineRest.length > 1 ? lineRest[1] === "]" === asArrayItem : !asArrayItem) || throws(SyntaxError$1(`Square brackets of Table definition statement not match` + where(" at ")));
|
|
663
|
+
lineRest = lineRest.slice(asArrayItem ? 2 : 1).replace(PRE_WHITESPACE, "");
|
|
664
|
+
let tag;
|
|
665
|
+
if (lineRest && lineRest[0] === "<") {
|
|
666
|
+
({ 1: tag, 2: lineRest } = TAG_REST_exec(lineRest) || throws(SyntaxError$1(`Bad tag` + where(" at "))));
|
|
667
|
+
} else {
|
|
668
|
+
tag = "";
|
|
669
|
+
}
|
|
670
|
+
return { leadingKeys, finalKey, asArrayItem, tag, lineRest };
|
|
671
|
+
};
|
|
672
|
+
var KEY_VALUE_PAIR_exec_groups = ({ leadingKeys, finalKey, lineRest }) => {
|
|
673
|
+
const { 1: tag = "" } = { 2: lineRest } = KEY_VALUE_PAIR_exec(lineRest) || throws(SyntaxError$1(`Keys must equal something` + where(", but missing at ")));
|
|
674
|
+
tag || lineRest && lineRest[0] !== "#" || throws(SyntaxError$1(`Value can not be missing after euqal sign` + where(", which is found at ")));
|
|
675
|
+
return { leadingKeys, finalKey, tag, lineRest };
|
|
676
|
+
};
|
|
677
|
+
var { test: CONTROL_CHARACTER_EXCLUDE_TAB____ } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]/);
|
|
678
|
+
var { test: CONTROL_CHARACTER_EXCLUDE_TAB_DEL } = theRegExp(/[\x00-\x08\x0B-\x1F]/);
|
|
679
|
+
var __CONTROL_CHARACTER_EXCLUDE_test = CONTROL_CHARACTER_EXCLUDE_TAB____;
|
|
680
|
+
var switchRegExp = (specificationVersion) => {
|
|
681
|
+
switch (specificationVersion) {
|
|
682
|
+
case 1:
|
|
683
|
+
__MULTI_LINE_LITERAL_STRING_exec = MULTI_LINE_LITERAL_STRING_0_1_2;
|
|
684
|
+
__LITERAL_KEY_exec = LITERAL_KEY____;
|
|
685
|
+
__CONTROL_CHARACTER_EXCLUDE_test = CONTROL_CHARACTER_EXCLUDE_TAB____;
|
|
686
|
+
__ESCAPED_EXCLUDE_CONTROL_CHARACTER = ESCAPED_EXCLUDE_CONTROL_CHARACTER_TAB______;
|
|
687
|
+
__BASIC_STRING = BASIC_STRING_TAB______;
|
|
688
|
+
__BARE_KEY_exec = BARE_KEY_STRICT;
|
|
689
|
+
supportArrayOfTables = true;
|
|
690
|
+
break;
|
|
691
|
+
case 0.5:
|
|
692
|
+
__MULTI_LINE_LITERAL_STRING_exec = MULTI_LINE_LITERAL_STRING_0;
|
|
693
|
+
__LITERAL_KEY_exec = LITERAL_KEY____;
|
|
694
|
+
__CONTROL_CHARACTER_EXCLUDE_test = CONTROL_CHARACTER_EXCLUDE_TAB____;
|
|
695
|
+
__ESCAPED_EXCLUDE_CONTROL_CHARACTER = ESCAPED_EXCLUDE_CONTROL_CHARACTER__________;
|
|
696
|
+
__BASIC_STRING = BASIC_STRING__________;
|
|
697
|
+
__BARE_KEY_exec = BARE_KEY_STRICT;
|
|
698
|
+
supportArrayOfTables = true;
|
|
699
|
+
break;
|
|
700
|
+
case 0.4:
|
|
701
|
+
__MULTI_LINE_LITERAL_STRING_exec = MULTI_LINE_LITERAL_STRING_0;
|
|
702
|
+
__LITERAL_KEY_exec = LITERAL_KEY_DEL;
|
|
703
|
+
__CONTROL_CHARACTER_EXCLUDE_test = CONTROL_CHARACTER_EXCLUDE_TAB_DEL;
|
|
704
|
+
__ESCAPED_EXCLUDE_CONTROL_CHARACTER = ESCAPED_EXCLUDE_CONTROL_CHARACTER_DEL______;
|
|
705
|
+
__BASIC_STRING = BASIC_STRING_DEL______;
|
|
706
|
+
__BARE_KEY_exec = BARE_KEY_STRICT;
|
|
707
|
+
supportArrayOfTables = true;
|
|
708
|
+
break;
|
|
709
|
+
default:
|
|
710
|
+
__MULTI_LINE_LITERAL_STRING_exec = MULTI_LINE_LITERAL_STRING_0;
|
|
711
|
+
__LITERAL_KEY_exec = LITERAL_KEY_DEL;
|
|
712
|
+
__CONTROL_CHARACTER_EXCLUDE_test = CONTROL_CHARACTER_EXCLUDE_TAB_DEL;
|
|
713
|
+
__ESCAPED_EXCLUDE_CONTROL_CHARACTER = ESCAPED_EXCLUDE_CONTROL_CHARACTER_DEL_SLASH;
|
|
714
|
+
__BASIC_STRING = BASIC_STRING_DEL_SLASH;
|
|
715
|
+
__BARE_KEY_exec = BARE_KEY_FREE;
|
|
716
|
+
supportArrayOfTables = false;
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
var NUM = /* @__PURE__ */ newRegExp`
|
|
720
|
+
(?:
|
|
721
|
+
0
|
|
722
|
+
(?:
|
|
723
|
+
b[01][_01]*
|
|
724
|
+
|
|
|
725
|
+
o[0-7][_0-7]*
|
|
726
|
+
|
|
|
727
|
+
x[\dA-Fa-f][_\dA-Fa-f]*
|
|
728
|
+
|
|
|
729
|
+
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
|
|
730
|
+
)
|
|
731
|
+
|
|
|
732
|
+
[1-9][_\d]*
|
|
733
|
+
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
|
|
734
|
+
|
|
|
735
|
+
inf
|
|
736
|
+
|
|
|
737
|
+
nan
|
|
738
|
+
)
|
|
739
|
+
`.valueOf();
|
|
740
|
+
var { test: IS_AMAZING } = /* @__PURE__ */ newRegExp`
|
|
741
|
+
^(?:
|
|
742
|
+
-?${NUM}
|
|
743
|
+
(?:-${NUM})*
|
|
744
|
+
|
|
|
745
|
+
true
|
|
746
|
+
|
|
|
747
|
+
false
|
|
748
|
+
)$
|
|
749
|
+
`.valueOf();
|
|
750
|
+
var { test: BAD_DXOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
|
|
751
|
+
var isAmazing = (keys2) => IS_AMAZING(keys2) && !BAD_DXOB(keys2);
|
|
752
|
+
var mustScalar = true;
|
|
753
|
+
var ARGS_MODE = "";
|
|
754
|
+
var useWhatToJoinMultilineString = null;
|
|
755
|
+
var usingBigInt = true;
|
|
756
|
+
var IntegerMinNumber = 0;
|
|
757
|
+
var IntegerMaxNumber = 0;
|
|
758
|
+
var ANY = {
|
|
759
|
+
test: () => true
|
|
760
|
+
};
|
|
761
|
+
var Keys = class KeysRegExp extends RegExp$1 {
|
|
762
|
+
constructor(keys2) {
|
|
763
|
+
super(`^${groupify(keys2)}$`);
|
|
764
|
+
let maxLength = -1;
|
|
765
|
+
for (let index = keys2.length; index; ) {
|
|
766
|
+
const { length } = keys2[--index];
|
|
767
|
+
if (length > maxLength) {
|
|
768
|
+
maxLength = length;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
this.lastIndex = maxLength + 1;
|
|
772
|
+
return this;
|
|
773
|
+
}
|
|
774
|
+
test(key) {
|
|
775
|
+
return key.length < this.lastIndex && super.test(key);
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
var isKeys = /* @__PURE__ */ isPrototypeOf.bind(/* @__PURE__ */ freeze(Keys.prototype));
|
|
779
|
+
var KEYS$1 = ANY;
|
|
780
|
+
var preserveLiteral;
|
|
781
|
+
var zeroDatetime;
|
|
782
|
+
var inlineTable;
|
|
783
|
+
var moreDatetime;
|
|
784
|
+
var disallowEmptyKey;
|
|
785
|
+
var sError;
|
|
786
|
+
var sFloat;
|
|
787
|
+
var Table3;
|
|
788
|
+
var allowLonger;
|
|
789
|
+
var enableNull;
|
|
790
|
+
var allowInlineTableMultilineAndTrailingCommaEvenNoComma;
|
|
791
|
+
var preserveComment;
|
|
792
|
+
var disableDigit;
|
|
793
|
+
var arrayTypes = new WeakMap$1();
|
|
794
|
+
var arrayTypes_get = /* @__PURE__ */ get.bind(arrayTypes);
|
|
795
|
+
var arrayTypes_set = /* @__PURE__ */ set.bind(arrayTypes);
|
|
796
|
+
var As = () => {
|
|
797
|
+
const as = (array) => {
|
|
798
|
+
const got = arrayTypes_get(array);
|
|
799
|
+
got ? got === as || throws(TypeError$1(`Types in Array must be same` + where(". Check "))) : arrayTypes_set(array, as);
|
|
800
|
+
return array;
|
|
801
|
+
};
|
|
802
|
+
return as;
|
|
803
|
+
};
|
|
804
|
+
var AS_TYPED = {
|
|
805
|
+
asNulls: As(),
|
|
806
|
+
asStrings: As(),
|
|
807
|
+
asTables: As(),
|
|
808
|
+
asArrays: As(),
|
|
809
|
+
asBooleans: As(),
|
|
810
|
+
asFloats: As(),
|
|
811
|
+
asIntegers: As(),
|
|
812
|
+
asOffsetDateTimes: As(),
|
|
813
|
+
asLocalDateTimes: As(),
|
|
814
|
+
asLocalDates: As(),
|
|
815
|
+
asLocalTimes: As()
|
|
816
|
+
};
|
|
817
|
+
var asMixed = (array) => array;
|
|
818
|
+
var asNulls;
|
|
819
|
+
var asStrings;
|
|
820
|
+
var asTables;
|
|
821
|
+
var asArrays;
|
|
822
|
+
var asBooleans;
|
|
823
|
+
var asFloats;
|
|
824
|
+
var asIntegers;
|
|
825
|
+
var asOffsetDateTimes;
|
|
826
|
+
var asLocalDateTimes;
|
|
827
|
+
var asLocalDates;
|
|
828
|
+
var asLocalTimes;
|
|
829
|
+
var processor = null;
|
|
830
|
+
var each = null;
|
|
831
|
+
var collect_on = (tag, array, table, key) => {
|
|
832
|
+
const _each = create$1(NULL);
|
|
833
|
+
_each._linked = each;
|
|
834
|
+
_each.tag = tag;
|
|
835
|
+
if (table) {
|
|
836
|
+
_each.table = table;
|
|
837
|
+
_each.key = key;
|
|
838
|
+
}
|
|
839
|
+
if (array) {
|
|
840
|
+
_each.array = array;
|
|
841
|
+
_each.index = array.length;
|
|
842
|
+
}
|
|
843
|
+
each = _each;
|
|
844
|
+
};
|
|
845
|
+
var collect_off = () => {
|
|
846
|
+
throw throws(SyntaxError$1(`xOptions.tag is not enabled, but found tag syntax` + where(" at ")));
|
|
847
|
+
};
|
|
848
|
+
var collect = collect_off;
|
|
849
|
+
var Process = () => {
|
|
850
|
+
if (each) {
|
|
851
|
+
const _processor = processor;
|
|
852
|
+
let _each = each;
|
|
853
|
+
each = null;
|
|
854
|
+
return () => {
|
|
855
|
+
const processor2 = _processor;
|
|
856
|
+
let each2 = _each;
|
|
857
|
+
_each = null;
|
|
858
|
+
do {
|
|
859
|
+
processor2(each2);
|
|
860
|
+
} while (each2 = each2._linked);
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
return null;
|
|
864
|
+
};
|
|
865
|
+
var clear = () => {
|
|
866
|
+
KEYS$1 = ANY;
|
|
867
|
+
useWhatToJoinMultilineString = processor = each = null;
|
|
868
|
+
zeroDatetime = false;
|
|
869
|
+
};
|
|
870
|
+
var use = (specificationVersion, multilineStringJoiner, useBigInt, keys2, xOptions, argsMode) => {
|
|
871
|
+
ARGS_MODE = argsMode;
|
|
872
|
+
let mixed;
|
|
873
|
+
switch (specificationVersion) {
|
|
874
|
+
case 1:
|
|
875
|
+
mustScalar = mixed = moreDatetime = sFloat = inlineTable = true;
|
|
876
|
+
zeroDatetime = disallowEmptyKey = false;
|
|
877
|
+
break;
|
|
878
|
+
case 0.5:
|
|
879
|
+
mustScalar = moreDatetime = sFloat = inlineTable = true;
|
|
880
|
+
mixed = zeroDatetime = disallowEmptyKey = false;
|
|
881
|
+
break;
|
|
882
|
+
case 0.4:
|
|
883
|
+
mustScalar = disallowEmptyKey = inlineTable = true;
|
|
884
|
+
mixed = zeroDatetime = moreDatetime = sFloat = false;
|
|
885
|
+
break;
|
|
886
|
+
case 0.3:
|
|
887
|
+
mustScalar = disallowEmptyKey = true;
|
|
888
|
+
mixed = zeroDatetime = moreDatetime = sFloat = inlineTable = false;
|
|
889
|
+
break;
|
|
890
|
+
case 0.2:
|
|
891
|
+
zeroDatetime = disallowEmptyKey = true;
|
|
892
|
+
mustScalar = mixed = moreDatetime = sFloat = inlineTable = false;
|
|
893
|
+
break;
|
|
894
|
+
case 0.1:
|
|
895
|
+
zeroDatetime = disallowEmptyKey = true;
|
|
896
|
+
mustScalar = mixed = moreDatetime = sFloat = inlineTable = false;
|
|
897
|
+
break;
|
|
898
|
+
default:
|
|
899
|
+
throw RangeError$1(`TOML.parse(,specificationVersion)`);
|
|
900
|
+
}
|
|
901
|
+
switchRegExp(specificationVersion);
|
|
902
|
+
if (typeof multilineStringJoiner === "string") {
|
|
903
|
+
useWhatToJoinMultilineString = multilineStringJoiner;
|
|
904
|
+
} else if (multilineStringJoiner === undefined$1) {
|
|
905
|
+
useWhatToJoinMultilineString = null;
|
|
906
|
+
} else {
|
|
907
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE}multilineStringJoiner` : `,{ joiner }`})`);
|
|
908
|
+
}
|
|
909
|
+
if (useBigInt === undefined$1 || useBigInt === true) {
|
|
910
|
+
usingBigInt = true;
|
|
911
|
+
} else if (useBigInt === false) {
|
|
912
|
+
usingBigInt = false;
|
|
913
|
+
} else {
|
|
914
|
+
if (typeof useBigInt !== "number") {
|
|
915
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},useBigInt` : `,{ bigint }`})`);
|
|
916
|
+
}
|
|
917
|
+
if (!isSafeInteger(useBigInt)) {
|
|
918
|
+
throw RangeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},useBigInt` : `,{ bigint }`})`);
|
|
919
|
+
}
|
|
920
|
+
usingBigInt = null;
|
|
921
|
+
useBigInt >= 0 ? IntegerMinNumber = -(IntegerMaxNumber = useBigInt) : IntegerMaxNumber = -(IntegerMinNumber = useBigInt) - 1;
|
|
922
|
+
}
|
|
923
|
+
if (!BigInt$1 && usingBigInt !== false) {
|
|
924
|
+
throw Error$1(`Can't work without TOML.parse(${ARGS_MODE ? `${ARGS_MODE},useBigInt` : `,{ bigint }`}) being set to false, because the host doesn't have BigInt support`);
|
|
925
|
+
}
|
|
926
|
+
if (keys2 == null) {
|
|
927
|
+
KEYS$1 = ANY;
|
|
928
|
+
} else {
|
|
929
|
+
if (!isKeys(keys2)) {
|
|
930
|
+
throw TypeError$1(`TOML.parse(,{ keys })`);
|
|
931
|
+
}
|
|
932
|
+
KEYS$1 = keys2;
|
|
933
|
+
}
|
|
934
|
+
if (xOptions == null) {
|
|
935
|
+
Table3 = PlainTable;
|
|
936
|
+
sError = allowLonger = enableNull = allowInlineTableMultilineAndTrailingCommaEvenNoComma = false;
|
|
937
|
+
collect = collect_off;
|
|
938
|
+
} else if (typeof xOptions !== "object") {
|
|
939
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},,xOptions` : `,{ x }`})`);
|
|
940
|
+
} else {
|
|
941
|
+
const { order, longer, exact, null: _null, multi, comment, string, literal: literal2, tag, ...unknown } = xOptions;
|
|
942
|
+
const unknownNames = getOwnPropertyNames(unknown);
|
|
943
|
+
if (unknownNames.length) {
|
|
944
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},,{ ${unknownNames.join(", ")} }` : `,{ x: { ${unknownNames.join(", ")} } }`})`);
|
|
945
|
+
}
|
|
946
|
+
Table3 = order ? OrderedTable : PlainTable;
|
|
947
|
+
allowLonger = !longer;
|
|
948
|
+
sError = !!exact;
|
|
949
|
+
enableNull = !!_null;
|
|
950
|
+
allowInlineTableMultilineAndTrailingCommaEvenNoComma = !!multi;
|
|
951
|
+
preserveComment = !!comment;
|
|
952
|
+
disableDigit = !!string;
|
|
953
|
+
preserveLiteral = !!literal2;
|
|
954
|
+
if (tag) {
|
|
955
|
+
if (typeof tag !== "function") {
|
|
956
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},,{ tag }` : `,{ x: { tag } }`})`);
|
|
957
|
+
}
|
|
958
|
+
if (!mixed) {
|
|
959
|
+
throw TypeError$1(`TOML.parse(${ARGS_MODE ? `${ARGS_MODE},,xOptions` : `,{ x }`}) xOptions.tag needs at least TOML 1.0 to support mixed type array`);
|
|
960
|
+
}
|
|
961
|
+
processor = tag;
|
|
962
|
+
collect = collect_on;
|
|
963
|
+
} else {
|
|
964
|
+
collect = collect_off;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
mixed ? asNulls = asStrings = asTables = asArrays = asBooleans = asFloats = asIntegers = asOffsetDateTimes = asLocalDateTimes = asLocalDates = asLocalTimes = asMixed : { asNulls, asStrings, asTables, asArrays, asBooleans, asFloats, asIntegers, asOffsetDateTimes, asLocalDateTimes, asLocalDates, asLocalTimes } = AS_TYPED;
|
|
968
|
+
};
|
|
969
|
+
var isView = ArrayBuffer.isView;
|
|
970
|
+
var isArrayBuffer = (
|
|
971
|
+
/* j-globals: class.isArrayBuffer (internal) */
|
|
972
|
+
/* @__PURE__ */ function() {
|
|
973
|
+
if (typeof ArrayBuffer === "function") {
|
|
974
|
+
var byteLength_apply = apply.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get);
|
|
975
|
+
return function isArrayBuffer2(value) {
|
|
976
|
+
try {
|
|
977
|
+
byteLength_apply(value);
|
|
978
|
+
} catch (error) {
|
|
979
|
+
return false;
|
|
980
|
+
}
|
|
981
|
+
return true;
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
return function isArrayBuffer2() {
|
|
985
|
+
return false;
|
|
986
|
+
};
|
|
987
|
+
}()
|
|
988
|
+
);
|
|
989
|
+
var TextDecoder$1 = TextDecoder;
|
|
990
|
+
var Symbol$1 = Symbol;
|
|
991
|
+
var previous = Symbol$1("previous");
|
|
992
|
+
var x = (rootStack) => {
|
|
993
|
+
let stack = rootStack;
|
|
994
|
+
let result = stack.next();
|
|
995
|
+
if (!result.done) {
|
|
996
|
+
result.value[previous] = stack;
|
|
997
|
+
result = (stack = result.value).next();
|
|
998
|
+
for (; ; ) {
|
|
999
|
+
if (result.done) {
|
|
1000
|
+
if (stack === rootStack) {
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
stack = stack[previous];
|
|
1004
|
+
result = stack.next(result.value);
|
|
1005
|
+
} else {
|
|
1006
|
+
result.value[previous] = stack;
|
|
1007
|
+
result = (stack = result.value).next();
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
return result.value;
|
|
1012
|
+
};
|
|
1013
|
+
var _literal = Symbol$1("_literal");
|
|
1014
|
+
var LiteralObject = (literal2, value) => {
|
|
1015
|
+
const object = Object$1(value);
|
|
1016
|
+
object[_literal] = literal2;
|
|
1017
|
+
return object;
|
|
1018
|
+
};
|
|
1019
|
+
var arrays = new WeakSet$1();
|
|
1020
|
+
var arrays_add = /* @__PURE__ */ add.bind(arrays);
|
|
1021
|
+
var isArray = /* @__PURE__ */ has.bind(arrays);
|
|
1022
|
+
var OF_TABLES = false;
|
|
1023
|
+
var STATICALLY = true;
|
|
1024
|
+
var staticalArrays = new WeakSet$1();
|
|
1025
|
+
var staticalArrays_add = /* @__PURE__ */ add.bind(staticalArrays);
|
|
1026
|
+
var isStatic = /* @__PURE__ */ has.bind(staticalArrays);
|
|
1027
|
+
var newArray = (isStatic2) => {
|
|
1028
|
+
const array = [];
|
|
1029
|
+
arrays_add(array);
|
|
1030
|
+
isStatic2 && staticalArrays_add(array);
|
|
1031
|
+
return array;
|
|
1032
|
+
};
|
|
1033
|
+
var NativeDate = Date;
|
|
1034
|
+
var parse$2 = Date.parse;
|
|
1035
|
+
var preventExtensions = Object.preventExtensions;
|
|
1036
|
+
var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
|
|
1037
|
+
var defineProperties = (
|
|
1038
|
+
/* j-globals: null.defineProperties (internal) */
|
|
1039
|
+
function defineProperties2(object, descriptorMap) {
|
|
1040
|
+
var created = create$1(NULL);
|
|
1041
|
+
var names = keys(descriptorMap);
|
|
1042
|
+
for (var length = names.length, index = 0; index < length; ++index) {
|
|
1043
|
+
var name = names[index];
|
|
1044
|
+
created[name] = Descriptor(descriptorMap[name]);
|
|
1045
|
+
}
|
|
1046
|
+
if (getOwnPropertySymbols) {
|
|
1047
|
+
var symbols = getOwnPropertySymbols(descriptorMap);
|
|
1048
|
+
for (length = symbols.length, index = 0; index < length; ++index) {
|
|
1049
|
+
var symbol = symbols[index];
|
|
1050
|
+
if (isEnum(descriptorMap, symbol)) {
|
|
1051
|
+
created[symbol] = Descriptor(descriptorMap[symbol]);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return Object_defineProperties(object, created);
|
|
1056
|
+
}
|
|
1057
|
+
);
|
|
1058
|
+
var fpc = (c) => {
|
|
1059
|
+
freeze(freeze(c).prototype);
|
|
1060
|
+
return c;
|
|
1061
|
+
};
|
|
1062
|
+
var _29_ = /(?:0[1-9]|1\d|2\d)/;
|
|
1063
|
+
var _30_ = /(?:0[1-9]|[12]\d|30)/;
|
|
1064
|
+
var _31_ = /(?:0[1-9]|[12]\d|3[01])/;
|
|
1065
|
+
var _23_ = /(?:[01]\d|2[0-3])/;
|
|
1066
|
+
var _59_ = /[0-5]\d/;
|
|
1067
|
+
var YMD = /* @__PURE__ */ newRegExp`
|
|
1068
|
+
\d\d\d\d-
|
|
1069
|
+
(?:
|
|
1070
|
+
0
|
|
1071
|
+
(?:
|
|
1072
|
+
[13578]-${_31_}
|
|
1073
|
+
|
|
|
1074
|
+
[469]-${_30_}
|
|
1075
|
+
|
|
|
1076
|
+
2-${_29_}
|
|
1077
|
+
)
|
|
1078
|
+
|
|
|
1079
|
+
1
|
|
1080
|
+
(?:
|
|
1081
|
+
[02]-${_31_}
|
|
1082
|
+
|
|
|
1083
|
+
1-${_30_}
|
|
1084
|
+
)
|
|
1085
|
+
)
|
|
1086
|
+
`.valueOf();
|
|
1087
|
+
var HMS = /* @__PURE__ */ newRegExp`
|
|
1088
|
+
${_23_}:${_59_}:${_59_}
|
|
1089
|
+
`.valueOf();
|
|
1090
|
+
var OFFSET$ = /(?:[Zz]|[+-]\d\d:\d\d)$/;
|
|
1091
|
+
var { exec: Z_exec } = theRegExp(/(([+-])\d\d):(\d\d)$/);
|
|
1092
|
+
var { exec: OFFSET_DATETIME_exec } = /* @__PURE__ */ newRegExp`
|
|
1093
|
+
^
|
|
1094
|
+
${YMD}
|
|
1095
|
+
[Tt ]
|
|
1096
|
+
${HMS}
|
|
1097
|
+
(?:\.\d{1,3}(\d*?)0*)?
|
|
1098
|
+
(?:[Zz]|[+-]${_23_}:${_59_})
|
|
1099
|
+
$`.valueOf();
|
|
1100
|
+
var { exec: OFFSET_DATETIME_ZERO_exec } = /* @__PURE__ */ newRegExp`
|
|
1101
|
+
^
|
|
1102
|
+
${YMD}
|
|
1103
|
+
[Tt ]
|
|
1104
|
+
${HMS}
|
|
1105
|
+
()
|
|
1106
|
+
[Zz]
|
|
1107
|
+
$`.valueOf();
|
|
1108
|
+
var { test: IS_LOCAL_DATETIME } = /* @__PURE__ */ newRegExp`
|
|
1109
|
+
^
|
|
1110
|
+
${YMD}
|
|
1111
|
+
[Tt ]
|
|
1112
|
+
${HMS}
|
|
1113
|
+
(?:\.\d+)?
|
|
1114
|
+
$`.valueOf();
|
|
1115
|
+
var { test: IS_LOCAL_DATE } = /* @__PURE__ */ newRegExp`
|
|
1116
|
+
^
|
|
1117
|
+
${YMD}
|
|
1118
|
+
$`.valueOf();
|
|
1119
|
+
var { test: IS_LOCAL_TIME } = /* @__PURE__ */ newRegExp`
|
|
1120
|
+
^
|
|
1121
|
+
${HMS}
|
|
1122
|
+
(?:\.\d+)?
|
|
1123
|
+
$`.valueOf();
|
|
1124
|
+
var T = /[ t]/;
|
|
1125
|
+
var DELIMITER_DOT = /[-T:.]/g;
|
|
1126
|
+
var DOT_ZERO = /\.?0+$/;
|
|
1127
|
+
var ZERO = /\.(\d*?)0+$/;
|
|
1128
|
+
var zeroReplacer = (match, p1) => p1;
|
|
1129
|
+
var Datetime = /* @__PURE__ */ (() => {
|
|
1130
|
+
const Datetime2 = function() {
|
|
1131
|
+
return this;
|
|
1132
|
+
};
|
|
1133
|
+
const descriptors = Null$1(null);
|
|
1134
|
+
{
|
|
1135
|
+
const descriptor = Null$1(null);
|
|
1136
|
+
for (const key of ownKeys(NativeDate.prototype)) {
|
|
1137
|
+
key === "constructor" || key === "toJSON" || (descriptors[key] = descriptor);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
Datetime2.prototype = preventExtensions(create$1(NativeDate.prototype, descriptors));
|
|
1141
|
+
return freeze(Datetime2);
|
|
1142
|
+
})();
|
|
1143
|
+
var Value = (ISOString) => ISOString.replace(ZERO, zeroReplacer).replace(DELIMITER_DOT, "");
|
|
1144
|
+
var d = /./gs;
|
|
1145
|
+
var d2u = (d2) => "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009"[d2];
|
|
1146
|
+
var ValueOFFSET = (time, more) => time < 0 ? ("" + (time + 6216730554e4)).replace(d, d2u).padStart(14, "\u2000") + more.replace(d, d2u) + time : more ? (time + ".").padStart(16, "0") + more : ("" + time).padStart(15, "0");
|
|
1147
|
+
var validateLeap = (literal2) => {
|
|
1148
|
+
if (literal2.startsWith("02-29", 5)) {
|
|
1149
|
+
const year = +literal2.slice(0, 4);
|
|
1150
|
+
return year & 3 ? false : year % 100 ? true : year % 400 ? false : year % 3200 ? true : false;
|
|
1151
|
+
}
|
|
1152
|
+
return true;
|
|
1153
|
+
};
|
|
1154
|
+
var { test: VALIDATE_LEAP } = /* @__PURE__ */ newRegExp.s`^.....(?:06.30|12.31).23:59:59`.valueOf();
|
|
1155
|
+
var DATE$1 = /* @__PURE__ */ defineProperties(new NativeDate(0), /* @__PURE__ */ getOwnPropertyDescriptors(NativeDate.prototype));
|
|
1156
|
+
var OffsetDateTime_ISOString = Symbol$1("OffsetDateTime_ISOString");
|
|
1157
|
+
var OffsetDateTime_value = Symbol$1("OffsetDateTime_value");
|
|
1158
|
+
var OffsetDateTime_use = (that, $ = 0) => {
|
|
1159
|
+
DATE$1.setTime(+that[OffsetDateTime_value] + $);
|
|
1160
|
+
return DATE$1;
|
|
1161
|
+
};
|
|
1162
|
+
var OffsetDateTime = /* @__PURE__ */ fpc(class OffsetDateTime2 extends Datetime {
|
|
1163
|
+
[OffsetDateTime_ISOString];
|
|
1164
|
+
[OffsetDateTime_value];
|
|
1165
|
+
get [Symbol$1.toStringTag]() {
|
|
1166
|
+
return "OffsetDateTime";
|
|
1167
|
+
}
|
|
1168
|
+
valueOf() {
|
|
1169
|
+
return this[OffsetDateTime_value];
|
|
1170
|
+
}
|
|
1171
|
+
toISOString() {
|
|
1172
|
+
return this[OffsetDateTime_ISOString];
|
|
1173
|
+
}
|
|
1174
|
+
constructor(literal2) {
|
|
1175
|
+
validateLeap(literal2) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal2}` + where(" at ")));
|
|
1176
|
+
const with60 = literal2.startsWith("60", 17);
|
|
1177
|
+
let without60 = with60 ? literal2.slice(0, 17) + "59" + literal2.slice(19) : literal2;
|
|
1178
|
+
const { 1: more = "" } = (zeroDatetime ? OFFSET_DATETIME_ZERO_exec(without60) : OFFSET_DATETIME_exec(without60)) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal2}` + where(" at ")));
|
|
1179
|
+
const time = parse$2(without60 = without60.replace(T, "T").replace("z", "Z"));
|
|
1180
|
+
if (with60) {
|
|
1181
|
+
DATE$1.setTime(time);
|
|
1182
|
+
VALIDATE_LEAP(DATE$1.toISOString()) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal2}` + where(" at ")));
|
|
1183
|
+
}
|
|
1184
|
+
super();
|
|
1185
|
+
this[OffsetDateTime_ISOString] = without60;
|
|
1186
|
+
this[OffsetDateTime_value] = ValueOFFSET(time, more);
|
|
1187
|
+
return this;
|
|
1188
|
+
}
|
|
1189
|
+
getUTCFullYear() {
|
|
1190
|
+
return OffsetDateTime_use(this).getUTCFullYear();
|
|
1191
|
+
}
|
|
1192
|
+
///get year () :FullYear { return OffsetDateTime_get(this, 0, 4); }
|
|
1193
|
+
///set year (value :FullYear) { OffsetDateTime_set(this, 0, 4, value, true); }
|
|
1194
|
+
getUTCMonth() {
|
|
1195
|
+
return OffsetDateTime_use(this).getUTCMonth();
|
|
1196
|
+
}
|
|
1197
|
+
///get month () { return OffsetDateTime_get(this, 5, 7); }
|
|
1198
|
+
///set month (value) { OffsetDateTime_set(this, 5, 7, value, true); }
|
|
1199
|
+
getUTCDate() {
|
|
1200
|
+
return OffsetDateTime_use(this).getUTCDate();
|
|
1201
|
+
}
|
|
1202
|
+
///get day () :Date { return OffsetDateTime_get(this, 8, 10); }
|
|
1203
|
+
///set day (value :Date) { OffsetDateTime_set(this, 8, 10, value, true); }
|
|
1204
|
+
getUTCHours() {
|
|
1205
|
+
return OffsetDateTime_use(this).getUTCHours();
|
|
1206
|
+
}
|
|
1207
|
+
///get hour () :Hours { return OffsetDateTime_get(this, 11, 13); }
|
|
1208
|
+
///set hour (value :Hours) { OffsetDateTime_set(this, 11, 13, value, true); }
|
|
1209
|
+
getUTCMinutes() {
|
|
1210
|
+
return OffsetDateTime_use(this).getUTCMinutes();
|
|
1211
|
+
}
|
|
1212
|
+
///get minute () :Minutes { return OffsetDateTime_get(this, 14, 16); }
|
|
1213
|
+
///set minute (value :Minutes) { OffsetDateTime_set(this, 14, 16, value, true); }
|
|
1214
|
+
getUTCSeconds() {
|
|
1215
|
+
return OffsetDateTime_use(this).getUTCSeconds();
|
|
1216
|
+
}
|
|
1217
|
+
///get second () :Seconds { return OffsetDateTime_get(this, 17, 19); }
|
|
1218
|
+
///set second (value :Seconds) { OffsetDateTime_set(this, 17, 19, value, true); }
|
|
1219
|
+
getUTCMilliseconds() {
|
|
1220
|
+
return OffsetDateTime_use(this).getUTCMilliseconds();
|
|
1221
|
+
}
|
|
1222
|
+
///
|
|
1223
|
+
///get millisecond () :Milliseconds { return this[OffsetDateTime_value]%1000; }///
|
|
1224
|
+
/*set millisecond (value :Milliseconds) {
|
|
1225
|
+
this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, 19) + ( value ? ( '.' + ( '' + value ).padStart(3, '0') ).replace(DOT_ZERO, '') : '' ) + this[OffsetDateTime_ISOString].slice(this[OffsetDateTime_ISOString].search(OFFSET$));
|
|
1226
|
+
OffsetDateTime_set(this, 0, 0, 0, false);
|
|
1227
|
+
}*/
|
|
1228
|
+
//
|
|
1229
|
+
///get microsecond () :Milliseconds
|
|
1230
|
+
///set microsecond (value :Milliseconds)
|
|
1231
|
+
///get nanosecond () :Milliseconds
|
|
1232
|
+
///set nanosecond (value :Milliseconds)
|
|
1233
|
+
getUTCDay() {
|
|
1234
|
+
return OffsetDateTime_use(this).getUTCDay();
|
|
1235
|
+
}
|
|
1236
|
+
///get dayOfWeek () { return OffsetDateTime_use(this, this.getTimezoneOffset()*60000).getUTCDay() || 7; }
|
|
1237
|
+
getTimezoneOffset() {
|
|
1238
|
+
const z = Z_exec(this[OffsetDateTime_ISOString]);
|
|
1239
|
+
return z ? +z[1] * 60 + +(z[2] + z[3]) : 0;
|
|
1240
|
+
}
|
|
1241
|
+
///get offset () { return this[OffsetDateTime_ISOString].endsWith('Z') ? 'Z' : this[OffsetDateTime_ISOString].slice(-6); }
|
|
1242
|
+
/*set offset (value) {
|
|
1243
|
+
this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, this[OffsetDateTime_ISOString].endsWith('Z') ? -1 : -6) + value;
|
|
1244
|
+
OffsetDateTime_set(this, 0, 0, 0, true);
|
|
1245
|
+
}*/
|
|
1246
|
+
//
|
|
1247
|
+
getTime() {
|
|
1248
|
+
return floor(+this[OffsetDateTime_value]);
|
|
1249
|
+
}
|
|
1250
|
+
///
|
|
1251
|
+
/*setTime (this :OffsetDateTime, value :Time) :void {
|
|
1252
|
+
value = DATE.setTime(value);
|
|
1253
|
+
const z = Z_exec(this[OffsetDateTime_ISOString]);
|
|
1254
|
+
DATE.setTime(value + ( z ? +z[1]*60 + +( z[2] + z[3] ) : 0 )*60000);
|
|
1255
|
+
this[OffsetDateTime_ISOString] = z ? DATE.toISOString().slice(0, -1) + z[0] : DATE.toISOString();
|
|
1256
|
+
this[OffsetDateTime_value] = ValueOFFSET(value, '');
|
|
1257
|
+
///return value;
|
|
1258
|
+
}*/
|
|
1259
|
+
});
|
|
1260
|
+
var LocalDateTime_ISOString = Symbol$1("LocalDateTime_ISOString");
|
|
1261
|
+
var LocalDateTime_value = Symbol$1("LocalDateTime_value");
|
|
1262
|
+
var LocalDateTime_get = (that, start, end) => +that[LocalDateTime_ISOString].slice(start, end);
|
|
1263
|
+
var LocalDateTime_set = (that, start, end, value) => {
|
|
1264
|
+
const string = "" + value;
|
|
1265
|
+
const size = end - start;
|
|
1266
|
+
if (string.length > size) {
|
|
1267
|
+
throw RangeError$1();
|
|
1268
|
+
}
|
|
1269
|
+
that[LocalDateTime_value] = Value(
|
|
1270
|
+
that[LocalDateTime_ISOString] = that[LocalDateTime_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDateTime_ISOString].slice(end)
|
|
1271
|
+
);
|
|
1272
|
+
};
|
|
1273
|
+
var LocalDateTime = /* @__PURE__ */ fpc(class LocalDateTime2 extends Datetime {
|
|
1274
|
+
[LocalDateTime_ISOString];
|
|
1275
|
+
[LocalDateTime_value];
|
|
1276
|
+
get [Symbol$1.toStringTag]() {
|
|
1277
|
+
return "LocalDateTime";
|
|
1278
|
+
}
|
|
1279
|
+
valueOf() {
|
|
1280
|
+
return this[LocalDateTime_value];
|
|
1281
|
+
}
|
|
1282
|
+
toISOString() {
|
|
1283
|
+
return this[LocalDateTime_ISOString];
|
|
1284
|
+
}
|
|
1285
|
+
constructor(literal2) {
|
|
1286
|
+
IS_LOCAL_DATETIME(literal2) && validateLeap(literal2) || throws(SyntaxError$1(`Invalid Local Date-Time ${literal2}` + where(" at ")));
|
|
1287
|
+
super();
|
|
1288
|
+
this[LocalDateTime_value] = Value(
|
|
1289
|
+
this[LocalDateTime_ISOString] = literal2.replace(T, "T")
|
|
1290
|
+
);
|
|
1291
|
+
return this;
|
|
1292
|
+
}
|
|
1293
|
+
getFullYear() {
|
|
1294
|
+
return LocalDateTime_get(this, 0, 4);
|
|
1295
|
+
}
|
|
1296
|
+
setFullYear(value) {
|
|
1297
|
+
LocalDateTime_set(this, 0, 4, value);
|
|
1298
|
+
}
|
|
1299
|
+
getMonth() {
|
|
1300
|
+
return LocalDateTime_get(this, 5, 7) - 1;
|
|
1301
|
+
}
|
|
1302
|
+
setMonth(value) {
|
|
1303
|
+
LocalDateTime_set(this, 5, 7, value + 1);
|
|
1304
|
+
}
|
|
1305
|
+
getDate() {
|
|
1306
|
+
return LocalDateTime_get(this, 8, 10);
|
|
1307
|
+
}
|
|
1308
|
+
setDate(value) {
|
|
1309
|
+
LocalDateTime_set(this, 8, 10, value);
|
|
1310
|
+
}
|
|
1311
|
+
getHours() {
|
|
1312
|
+
return LocalDateTime_get(this, 11, 13);
|
|
1313
|
+
}
|
|
1314
|
+
setHours(value) {
|
|
1315
|
+
LocalDateTime_set(this, 11, 13, value);
|
|
1316
|
+
}
|
|
1317
|
+
getMinutes() {
|
|
1318
|
+
return LocalDateTime_get(this, 14, 16);
|
|
1319
|
+
}
|
|
1320
|
+
setMinutes(value) {
|
|
1321
|
+
LocalDateTime_set(this, 14, 16, value);
|
|
1322
|
+
}
|
|
1323
|
+
getSeconds() {
|
|
1324
|
+
return LocalDateTime_get(this, 17, 19);
|
|
1325
|
+
}
|
|
1326
|
+
setSeconds(value) {
|
|
1327
|
+
LocalDateTime_set(this, 17, 19, value);
|
|
1328
|
+
}
|
|
1329
|
+
getMilliseconds() {
|
|
1330
|
+
return +this[LocalDateTime_value].slice(14, 17).padEnd(3, "0");
|
|
1331
|
+
}
|
|
1332
|
+
///
|
|
1333
|
+
setMilliseconds(value) {
|
|
1334
|
+
this[LocalDateTime_value] = Value(
|
|
1335
|
+
this[LocalDateTime_ISOString] = this[LocalDateTime_ISOString].slice(0, 19) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
|
|
1336
|
+
);
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
var LocalDate_ISOString = Symbol$1("LocalDate_ISOString");
|
|
1340
|
+
var LocalDate_value = Symbol$1("LocalDate_value");
|
|
1341
|
+
var LocalDate_get = (that, start, end) => +that[LocalDate_ISOString].slice(start, end);
|
|
1342
|
+
var LocalDate_set = (that, start, end, value) => {
|
|
1343
|
+
const string = "" + value;
|
|
1344
|
+
const size = end - start;
|
|
1345
|
+
if (string.length > size) {
|
|
1346
|
+
throw RangeError$1();
|
|
1347
|
+
}
|
|
1348
|
+
that[LocalDate_value] = Value(
|
|
1349
|
+
that[LocalDate_ISOString] = that[LocalDate_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDate_ISOString].slice(end)
|
|
1350
|
+
);
|
|
1351
|
+
};
|
|
1352
|
+
var LocalDate = /* @__PURE__ */ fpc(class LocalDate2 extends Datetime {
|
|
1353
|
+
[LocalDate_ISOString];
|
|
1354
|
+
[LocalDate_value];
|
|
1355
|
+
get [Symbol$1.toStringTag]() {
|
|
1356
|
+
return "LocalDate";
|
|
1357
|
+
}
|
|
1358
|
+
valueOf() {
|
|
1359
|
+
return this[LocalDate_value];
|
|
1360
|
+
}
|
|
1361
|
+
toISOString() {
|
|
1362
|
+
return this[LocalDate_ISOString];
|
|
1363
|
+
}
|
|
1364
|
+
constructor(literal2) {
|
|
1365
|
+
IS_LOCAL_DATE(literal2) && validateLeap(literal2) || throws(SyntaxError$1(`Invalid Local Date ${literal2}` + where(" at ")));
|
|
1366
|
+
super();
|
|
1367
|
+
this[LocalDate_value] = Value(
|
|
1368
|
+
this[LocalDate_ISOString] = literal2
|
|
1369
|
+
);
|
|
1370
|
+
return this;
|
|
1371
|
+
}
|
|
1372
|
+
getFullYear() {
|
|
1373
|
+
return LocalDate_get(this, 0, 4);
|
|
1374
|
+
}
|
|
1375
|
+
setFullYear(value) {
|
|
1376
|
+
LocalDate_set(this, 0, 4, value);
|
|
1377
|
+
}
|
|
1378
|
+
getMonth() {
|
|
1379
|
+
return LocalDate_get(this, 5, 7) - 1;
|
|
1380
|
+
}
|
|
1381
|
+
setMonth(value) {
|
|
1382
|
+
LocalDate_set(this, 5, 7, value + 1);
|
|
1383
|
+
}
|
|
1384
|
+
getDate() {
|
|
1385
|
+
return LocalDate_get(this, 8, 10);
|
|
1386
|
+
}
|
|
1387
|
+
setDate(value) {
|
|
1388
|
+
LocalDate_set(this, 8, 10, value);
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
var LocalTime_ISOString = Symbol$1("LocalTime_ISOString");
|
|
1392
|
+
var LocalTime_value = Symbol$1("LocalTime_value");
|
|
1393
|
+
var LocalTime_get = (that, start, end) => +that[LocalTime_ISOString].slice(start, end);
|
|
1394
|
+
var LocalTime_set = (that, start, end, value) => {
|
|
1395
|
+
const string = "" + value;
|
|
1396
|
+
const size = end - start;
|
|
1397
|
+
if (string.length > size) {
|
|
1398
|
+
throw RangeError$1();
|
|
1399
|
+
}
|
|
1400
|
+
that[LocalTime_value] = Value(
|
|
1401
|
+
that[LocalTime_ISOString] = that[LocalTime_ISOString].slice(0, start) + string.padStart(2, "0") + that[LocalTime_ISOString].slice(end)
|
|
1402
|
+
);
|
|
1403
|
+
};
|
|
1404
|
+
var LocalTime = /* @__PURE__ */ fpc(class LocalTime2 extends Datetime {
|
|
1405
|
+
[LocalTime_ISOString];
|
|
1406
|
+
[LocalTime_value];
|
|
1407
|
+
get [Symbol$1.toStringTag]() {
|
|
1408
|
+
return "LocalTime";
|
|
1409
|
+
}
|
|
1410
|
+
valueOf() {
|
|
1411
|
+
return this[LocalTime_value];
|
|
1412
|
+
}
|
|
1413
|
+
toISOString() {
|
|
1414
|
+
return this[LocalTime_ISOString];
|
|
1415
|
+
}
|
|
1416
|
+
constructor(literal2) {
|
|
1417
|
+
IS_LOCAL_TIME(literal2) || throws(SyntaxError$1(`Invalid Local Time ${literal2}` + where(" at ")));
|
|
1418
|
+
super();
|
|
1419
|
+
this[LocalTime_value] = Value(
|
|
1420
|
+
this[LocalTime_ISOString] = literal2
|
|
1421
|
+
);
|
|
1422
|
+
return this;
|
|
1423
|
+
}
|
|
1424
|
+
getHours() {
|
|
1425
|
+
return LocalTime_get(this, 0, 2);
|
|
1426
|
+
}
|
|
1427
|
+
setHours(value) {
|
|
1428
|
+
LocalTime_set(this, 0, 2, value);
|
|
1429
|
+
}
|
|
1430
|
+
getMinutes() {
|
|
1431
|
+
return LocalTime_get(this, 3, 5);
|
|
1432
|
+
}
|
|
1433
|
+
setMinutes(value) {
|
|
1434
|
+
LocalTime_set(this, 3, 5, value);
|
|
1435
|
+
}
|
|
1436
|
+
getSeconds() {
|
|
1437
|
+
return LocalTime_get(this, 6, 8);
|
|
1438
|
+
}
|
|
1439
|
+
setSeconds(value) {
|
|
1440
|
+
LocalTime_set(this, 6, 8, value);
|
|
1441
|
+
}
|
|
1442
|
+
getMilliseconds() {
|
|
1443
|
+
return +this[LocalTime_value].slice(6, 9).padEnd(3, "0");
|
|
1444
|
+
}
|
|
1445
|
+
///
|
|
1446
|
+
setMilliseconds(value) {
|
|
1447
|
+
this[LocalTime_value] = Value(
|
|
1448
|
+
this[LocalTime_ISOString] = this[LocalTime_ISOString].slice(0, 8) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
var parseInt$1 = parseInt;
|
|
1453
|
+
var fromCodePoint = String.fromCodePoint;
|
|
1454
|
+
var ESCAPED_IN_SINGLE_LINE = /[^\\]+|\\(?:[\\"btnfr/]|u.{4}|U.{8})/gs;
|
|
1455
|
+
var ESCAPED_IN_MULTI_LINE = /[^\n\\]+|\n|\\(?:[\t ]*\n[\t\n ]*|[\\"btnfr/]|u.{4}|U.{8})/gs;
|
|
1456
|
+
var BasicString = (literal2) => {
|
|
1457
|
+
if (!literal2) {
|
|
1458
|
+
return "";
|
|
1459
|
+
}
|
|
1460
|
+
const parts = literal2.match(ESCAPED_IN_SINGLE_LINE);
|
|
1461
|
+
const { length } = parts;
|
|
1462
|
+
let index = 0;
|
|
1463
|
+
do {
|
|
1464
|
+
const part = parts[index];
|
|
1465
|
+
if (part[0] === "\\") {
|
|
1466
|
+
switch (part[1]) {
|
|
1467
|
+
case "\\":
|
|
1468
|
+
parts[index] = "\\";
|
|
1469
|
+
break;
|
|
1470
|
+
case '"':
|
|
1471
|
+
parts[index] = '"';
|
|
1472
|
+
break;
|
|
1473
|
+
case "b":
|
|
1474
|
+
parts[index] = "\b";
|
|
1475
|
+
break;
|
|
1476
|
+
case "t":
|
|
1477
|
+
parts[index] = " ";
|
|
1478
|
+
break;
|
|
1479
|
+
case "n":
|
|
1480
|
+
parts[index] = "\n";
|
|
1481
|
+
break;
|
|
1482
|
+
case "f":
|
|
1483
|
+
parts[index] = "\f";
|
|
1484
|
+
break;
|
|
1485
|
+
case "r":
|
|
1486
|
+
parts[index] = "\r";
|
|
1487
|
+
break;
|
|
1488
|
+
case "u":
|
|
1489
|
+
const charCode = parseInt$1(part.slice(2), 16);
|
|
1490
|
+
mustScalar && 55295 < charCode && charCode < 57344 && throws(RangeError$1(`Invalid Unicode Scalar ${part}` + where(" at ")));
|
|
1491
|
+
parts[index] = fromCharCode(charCode);
|
|
1492
|
+
break;
|
|
1493
|
+
case "U":
|
|
1494
|
+
const codePoint = parseInt$1(part.slice(2), 16);
|
|
1495
|
+
(mustScalar && 55295 < codePoint && codePoint < 57344 || 1114111 < codePoint) && throws(RangeError$1(`Invalid Unicode Scalar ${part}` + where(" at ")));
|
|
1496
|
+
parts[index] = fromCodePoint(codePoint);
|
|
1497
|
+
break;
|
|
1498
|
+
case "/":
|
|
1499
|
+
parts[index] = "/";
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
} while (++index !== length);
|
|
1504
|
+
return parts.join("");
|
|
1505
|
+
};
|
|
1506
|
+
var MultilineBasicString = (literal2, useWhatToJoinMultilineString2, n) => {
|
|
1507
|
+
if (!literal2) {
|
|
1508
|
+
return "";
|
|
1509
|
+
}
|
|
1510
|
+
const parts = literal2.match(ESCAPED_IN_MULTI_LINE);
|
|
1511
|
+
const { length } = parts;
|
|
1512
|
+
let index = 0;
|
|
1513
|
+
do {
|
|
1514
|
+
const part = parts[index];
|
|
1515
|
+
if (part === "\n") {
|
|
1516
|
+
++n;
|
|
1517
|
+
parts[index] = useWhatToJoinMultilineString2;
|
|
1518
|
+
} else if (part[0] === "\\") {
|
|
1519
|
+
switch (part[1]) {
|
|
1520
|
+
case "\n":
|
|
1521
|
+
case " ":
|
|
1522
|
+
case " ":
|
|
1523
|
+
for (let i = 0; i = part.indexOf("\n", i) + 1; ) {
|
|
1524
|
+
++n;
|
|
1525
|
+
}
|
|
1526
|
+
parts[index] = "";
|
|
1527
|
+
break;
|
|
1528
|
+
case "\\":
|
|
1529
|
+
parts[index] = "\\";
|
|
1530
|
+
break;
|
|
1531
|
+
case '"':
|
|
1532
|
+
parts[index] = '"';
|
|
1533
|
+
break;
|
|
1534
|
+
case "b":
|
|
1535
|
+
parts[index] = "\b";
|
|
1536
|
+
break;
|
|
1537
|
+
case "t":
|
|
1538
|
+
parts[index] = " ";
|
|
1539
|
+
break;
|
|
1540
|
+
case "n":
|
|
1541
|
+
parts[index] = "\n";
|
|
1542
|
+
break;
|
|
1543
|
+
case "f":
|
|
1544
|
+
parts[index] = "\f";
|
|
1545
|
+
break;
|
|
1546
|
+
case "r":
|
|
1547
|
+
parts[index] = "\r";
|
|
1548
|
+
break;
|
|
1549
|
+
case "u":
|
|
1550
|
+
const charCode = parseInt$1(part.slice(2), 16);
|
|
1551
|
+
mustScalar && 55295 < charCode && charCode < 57344 && throws(RangeError$1(`Invalid Unicode Scalar ${part}` + where(" at ", lineIndex + n)));
|
|
1552
|
+
parts[index] = fromCharCode(charCode);
|
|
1553
|
+
break;
|
|
1554
|
+
case "U":
|
|
1555
|
+
const codePoint = parseInt$1(part.slice(2), 16);
|
|
1556
|
+
(mustScalar && 55295 < codePoint && codePoint < 57344 || 1114111 < codePoint) && throws(RangeError$1(`Invalid Unicode Scalar ${part}` + where(" at ", lineIndex + n)));
|
|
1557
|
+
parts[index] = fromCodePoint(codePoint);
|
|
1558
|
+
break;
|
|
1559
|
+
case "/":
|
|
1560
|
+
parts[index] = "/";
|
|
1561
|
+
break;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
} while (++index !== length);
|
|
1565
|
+
return parts.join("");
|
|
1566
|
+
};
|
|
1567
|
+
var INTEGER_D = /[-+]?(?:0|[1-9][_\d]*)/;
|
|
1568
|
+
var { test: BAD_D } = /* @__PURE__ */ newRegExp`_(?!\d)`.valueOf();
|
|
1569
|
+
var { test: IS_D_INTEGER } = /* @__PURE__ */ newRegExp`^${INTEGER_D}$`.valueOf();
|
|
1570
|
+
var { test: IS_XOB_INTEGER } = theRegExp(/^0(?:x[\dA-Fa-f][_\dA-Fa-f]*|o[0-7][_0-7]*|b[01][_01]*)$/);
|
|
1571
|
+
var { test: BAD_XOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
|
|
1572
|
+
var UNDERSCORES$1 = /_/g;
|
|
1573
|
+
var UNDERSCORES_SIGN = /_|^[-+]/g;
|
|
1574
|
+
var IS_INTEGER = (literal2) => (IS_D_INTEGER(literal2) || /*options.xob && */
|
|
1575
|
+
IS_XOB_INTEGER(literal2)) && !BAD_XOB(literal2);
|
|
1576
|
+
var MIN = BigInt$1 && -/* @__PURE__ */ BigInt$1("0x8000000000000000");
|
|
1577
|
+
var MAX = BigInt$1 && /* @__PURE__ */ BigInt$1("0x7FFFFFFFFFFFFFFF");
|
|
1578
|
+
var BigIntInteger = (literal2) => {
|
|
1579
|
+
IS_INTEGER(literal2) || throws(SyntaxError$1(`Invalid Integer ${literal2}` + where(" at ")));
|
|
1580
|
+
const bigInt = literal2[0] === "-" ? -BigInt$1(literal2.replace(UNDERSCORES_SIGN, "")) : BigInt$1(literal2.replace(UNDERSCORES_SIGN, ""));
|
|
1581
|
+
allowLonger || MIN <= bigInt && bigInt <= MAX || throws(RangeError$1(`Integer expect 64 bit range (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807), not includes ${literal2}` + where(" meet at ")));
|
|
1582
|
+
return bigInt;
|
|
1583
|
+
};
|
|
1584
|
+
var NumberInteger = (literal2) => {
|
|
1585
|
+
IS_INTEGER(literal2) || throws(SyntaxError$1(`Invalid Integer ${literal2}` + where(" at ")));
|
|
1586
|
+
const number = parseInt$1(literal2.replace(UNDERSCORES$1, ""));
|
|
1587
|
+
isSafeInteger(number) || throws(RangeError$1(`Integer did not use BitInt must fit Number.isSafeInteger, not includes ${literal2}` + where(" meet at ")));
|
|
1588
|
+
return number;
|
|
1589
|
+
};
|
|
1590
|
+
var Integer = (literal2) => {
|
|
1591
|
+
if (usingBigInt === true) {
|
|
1592
|
+
return BigIntInteger(literal2);
|
|
1593
|
+
}
|
|
1594
|
+
if (usingBigInt === false) {
|
|
1595
|
+
return NumberInteger(literal2);
|
|
1596
|
+
}
|
|
1597
|
+
IS_INTEGER(literal2) || throws(SyntaxError$1(`Invalid Integer ${literal2}` + where(" at ")));
|
|
1598
|
+
const number = parseInt$1(literal2.replace(UNDERSCORES$1, ""));
|
|
1599
|
+
if (IntegerMinNumber <= number && number <= IntegerMaxNumber) {
|
|
1600
|
+
return number;
|
|
1601
|
+
}
|
|
1602
|
+
const bigInt = literal2[0] === "-" ? -BigInt$1(literal2.replace(UNDERSCORES_SIGN, "")) : BigInt$1(literal2.replace(UNDERSCORES_SIGN, ""));
|
|
1603
|
+
allowLonger || MIN <= bigInt && bigInt <= MAX || throws(RangeError$1(`Integer expect 64 bit range (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807), not includes ${literal2}` + where(" meet at ")));
|
|
1604
|
+
return bigInt;
|
|
1605
|
+
};
|
|
1606
|
+
var isFinite$1 = isFinite;
|
|
1607
|
+
var NaN$1 = 0 / 0;
|
|
1608
|
+
var _NaN = -NaN$1;
|
|
1609
|
+
var _Infinity$1 = -Infinity;
|
|
1610
|
+
var { test: IS_FLOAT } = /* @__PURE__ */ newRegExp`
|
|
1611
|
+
^
|
|
1612
|
+
${INTEGER_D}
|
|
1613
|
+
(?:
|
|
1614
|
+
\.\d[_\d]*
|
|
1615
|
+
(?:[eE][-+]?\d[_\d]*)?
|
|
1616
|
+
|
|
|
1617
|
+
[eE][-+]?\d[_\d]*
|
|
1618
|
+
)
|
|
1619
|
+
$`.valueOf();
|
|
1620
|
+
var UNDERSCORES = /_/g;
|
|
1621
|
+
var { test: IS_ZERO } = theRegExp(/^[-+]?0(?:\.0+)?(?:[eE][-+]?0+)?$/);
|
|
1622
|
+
var { exec: NORMALIZED } = theRegExp(/^[-0]?(\d*)(?:\.(\d+))?(?:e\+?(-?\d+))?$/);
|
|
1623
|
+
var { exec: ORIGINAL } = theRegExp(/^[-+]?0?(\d*)(?:\.(\d*?)0*)?(?:[eE]\+?(-?\d+))?$/);
|
|
1624
|
+
var Float = (literal2) => {
|
|
1625
|
+
if (!IS_FLOAT(literal2) || BAD_D(literal2)) {
|
|
1626
|
+
if (sFloat) {
|
|
1627
|
+
if (literal2 === "inf" || literal2 === "+inf") {
|
|
1628
|
+
return Infinity;
|
|
1629
|
+
}
|
|
1630
|
+
if (literal2 === "-inf") {
|
|
1631
|
+
return _Infinity$1;
|
|
1632
|
+
}
|
|
1633
|
+
if (literal2 === "nan" || literal2 === "+nan") {
|
|
1634
|
+
return NaN$1;
|
|
1635
|
+
}
|
|
1636
|
+
if (literal2 === "-nan") {
|
|
1637
|
+
return _NaN;
|
|
1638
|
+
}
|
|
1639
|
+
} else if (!sError) {
|
|
1640
|
+
if (literal2 === "inf" || literal2 === "+inf") {
|
|
1641
|
+
return Infinity;
|
|
1642
|
+
}
|
|
1643
|
+
if (literal2 === "-inf") {
|
|
1644
|
+
return _Infinity$1;
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
throw throws(SyntaxError$1(`Invalid Float ${literal2}` + where(" at ")));
|
|
1648
|
+
}
|
|
1649
|
+
const withoutUnderscores = literal2.replace(UNDERSCORES, "");
|
|
1650
|
+
const number = +withoutUnderscores;
|
|
1651
|
+
if (sError) {
|
|
1652
|
+
isFinite$1(number) || throws(RangeError$1(`Float ${literal2} has been as big as inf` + where(" at ")));
|
|
1653
|
+
number || IS_ZERO(withoutUnderscores) || throws(RangeError$1(`Float ${literal2} has been as little as ${literal2[0] === "-" ? "-" : ""}0` + where(" at ")));
|
|
1654
|
+
const { 1: normalized_integer, 2: normalized_fractional = "", 3: normalized_exponent = "" } = NORMALIZED(number);
|
|
1655
|
+
const { 1: original_integer, 2: original_fractional = "", 3: original_exponent = "" } = ORIGINAL(withoutUnderscores);
|
|
1656
|
+
original_integer + original_fractional === normalized_integer + normalized_fractional && original_exponent - original_fractional.length === normalized_exponent - normalized_fractional.length || throws(RangeError$1(`Float ${literal2} has lost its exact and been ${number}` + where(" at ")));
|
|
1657
|
+
}
|
|
1658
|
+
return number;
|
|
1659
|
+
};
|
|
1660
|
+
var prepareTable = (table, keys2) => {
|
|
1661
|
+
const { length } = keys2;
|
|
1662
|
+
let index = 0;
|
|
1663
|
+
while (index < length) {
|
|
1664
|
+
const key = keys2[index++];
|
|
1665
|
+
if (key in table) {
|
|
1666
|
+
table = table[key];
|
|
1667
|
+
if (isTable(table)) {
|
|
1668
|
+
isInline(table) && throws(Error$1(`Trying to define Table under Inline Table` + where(" at ")));
|
|
1669
|
+
} else if (isArray(table)) {
|
|
1670
|
+
isStatic(table) && throws(Error$1(`Trying to append value to Static Array` + where(" at ")));
|
|
1671
|
+
table = table[table.length - 1];
|
|
1672
|
+
} else {
|
|
1673
|
+
throw throws(Error$1(`Trying to define Table under non-Table value` + where(" at ")));
|
|
1674
|
+
}
|
|
1675
|
+
} else {
|
|
1676
|
+
table = table[key] = new Table3(IMPLICITLY);
|
|
1677
|
+
while (index < length) {
|
|
1678
|
+
table = table[keys2[index++]] = new Table3(IMPLICITLY);
|
|
1679
|
+
}
|
|
1680
|
+
return table;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
return table;
|
|
1684
|
+
};
|
|
1685
|
+
var appendTable = (table, finalKey, asArrayItem, tag) => {
|
|
1686
|
+
let lastTable;
|
|
1687
|
+
if (asArrayItem) {
|
|
1688
|
+
let arrayOfTables;
|
|
1689
|
+
if (finalKey in table) {
|
|
1690
|
+
isArray(arrayOfTables = table[finalKey]) && !isStatic(arrayOfTables) || throws(Error$1(`Trying to push Table to non-ArrayOfTables value` + where(" at ")));
|
|
1691
|
+
} else {
|
|
1692
|
+
arrayOfTables = table[finalKey] = newArray(OF_TABLES);
|
|
1693
|
+
}
|
|
1694
|
+
tag && collect(tag, arrayOfTables, table, finalKey);
|
|
1695
|
+
arrayOfTables[arrayOfTables.length] = lastTable = new Table3(DIRECTLY);
|
|
1696
|
+
} else {
|
|
1697
|
+
if (finalKey in table) {
|
|
1698
|
+
lastTable = table[finalKey];
|
|
1699
|
+
fromPair(lastTable) && throws(Error$1(`A table defined implicitly via key/value pair can not be accessed to via []` + where(", which at ")));
|
|
1700
|
+
directlyIfNot(lastTable) || throws(Error$1(`Duplicate Table definition` + where(" at ")));
|
|
1701
|
+
} else {
|
|
1702
|
+
table[finalKey] = lastTable = new Table3(DIRECTLY);
|
|
1703
|
+
}
|
|
1704
|
+
tag && collect(tag, null, table, finalKey);
|
|
1705
|
+
}
|
|
1706
|
+
return lastTable;
|
|
1707
|
+
};
|
|
1708
|
+
var prepareInlineTable = (table, keys2) => {
|
|
1709
|
+
const { length } = keys2;
|
|
1710
|
+
let index = 0;
|
|
1711
|
+
while (index < length) {
|
|
1712
|
+
const key = keys2[index++];
|
|
1713
|
+
if (key in table) {
|
|
1714
|
+
table = table[key];
|
|
1715
|
+
isTable(table) || throws(Error$1(`Trying to assign property through non-Table value` + where(" at ")));
|
|
1716
|
+
isInline(table) && throws(Error$1(`Trying to assign property through static Inline Table` + where(" at ")));
|
|
1717
|
+
fromPair(table) || throws(Error$1(`A table defined implicitly via [] can not be accessed to via key/value pair` + where(", which at ")));
|
|
1718
|
+
} else {
|
|
1719
|
+
table = table[key] = new Table3(IMPLICITLY, PAIR);
|
|
1720
|
+
while (index < length) {
|
|
1721
|
+
table = table[keys2[index++]] = new Table3(IMPLICITLY, PAIR);
|
|
1722
|
+
}
|
|
1723
|
+
return table;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
return table;
|
|
1727
|
+
};
|
|
1728
|
+
var checkLiteralString = (literal2) => {
|
|
1729
|
+
__CONTROL_CHARACTER_EXCLUDE_test(literal2) && throws(SyntaxError$1(`Control characters other than Tab are not permitted in a Literal String` + where(", which was found at ")));
|
|
1730
|
+
return literal2;
|
|
1731
|
+
};
|
|
1732
|
+
var assignLiteralString = (table, finalKey, literal2) => {
|
|
1733
|
+
if (!literal2.startsWith(`'''`)) {
|
|
1734
|
+
const $2 = LITERAL_STRING_exec(literal2) || throws(SyntaxError$1(`Bad literal string` + where(" at ")));
|
|
1735
|
+
const value = checkLiteralString($2[1]);
|
|
1736
|
+
table[finalKey] = preserveLiteral ? LiteralObject(literal2.slice(0, value.length + 2), value) : value;
|
|
1737
|
+
return $2[2];
|
|
1738
|
+
}
|
|
1739
|
+
const $ = __MULTI_LINE_LITERAL_STRING_exec(literal2.slice(3));
|
|
1740
|
+
if ($) {
|
|
1741
|
+
const value = checkLiteralString($[1]) + $[2];
|
|
1742
|
+
table[finalKey] = preserveLiteral ? LiteralObject(literal2.slice(0, value.length + 6), value) : value;
|
|
1743
|
+
return $[3];
|
|
1744
|
+
}
|
|
1745
|
+
const start = new mark("Multi-line Literal String", literal2.length);
|
|
1746
|
+
const leadingNewline = !(literal2 = literal2.slice(3));
|
|
1747
|
+
if (leadingNewline) {
|
|
1748
|
+
literal2 = start.must();
|
|
1749
|
+
const $2 = __MULTI_LINE_LITERAL_STRING_exec(literal2);
|
|
1750
|
+
if ($2) {
|
|
1751
|
+
const value = checkLiteralString($2[1]) + $2[2];
|
|
1752
|
+
table[finalKey] = preserveLiteral ? LiteralObject([`'''`, literal2.slice(0, value.length + 3)], value) : value;
|
|
1753
|
+
return $2[3];
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
useWhatToJoinMultilineString === null && start.nowrap(ARGS_MODE);
|
|
1757
|
+
for (const lines = [checkLiteralString(literal2)]; ; ) {
|
|
1758
|
+
const line = start.must();
|
|
1759
|
+
const $2 = __MULTI_LINE_LITERAL_STRING_exec(line);
|
|
1760
|
+
if ($2) {
|
|
1761
|
+
lines[lines.length] = checkLiteralString($2[1]) + $2[2];
|
|
1762
|
+
const value = lines.join(useWhatToJoinMultilineString);
|
|
1763
|
+
if (preserveLiteral) {
|
|
1764
|
+
lines[lines.length - 1] += `'''`;
|
|
1765
|
+
leadingNewline ? lines.unshift(`'''`) : lines[0] = `'''${literal2}`;
|
|
1766
|
+
table[finalKey] = LiteralObject(lines, value);
|
|
1767
|
+
} else {
|
|
1768
|
+
table[finalKey] = value;
|
|
1769
|
+
}
|
|
1770
|
+
return $2[3];
|
|
1771
|
+
}
|
|
1772
|
+
lines[lines.length] = checkLiteralString(line);
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
var assignBasicString = (table, finalKey, literal2) => {
|
|
1776
|
+
if (!literal2.startsWith('"""')) {
|
|
1777
|
+
const index = BASIC_STRING_exec_1_endIndex(literal2);
|
|
1778
|
+
const value = BasicString(literal2.slice(1, index));
|
|
1779
|
+
table[finalKey] = preserveLiteral ? LiteralObject(literal2.slice(0, index + 1), value) : value;
|
|
1780
|
+
return literal2.slice(index + 1).replace(PRE_WHITESPACE, "");
|
|
1781
|
+
}
|
|
1782
|
+
let length = 3 + MULTI_LINE_BASIC_STRING_exec_0_length(literal2.slice(3));
|
|
1783
|
+
if (literal2.length !== length) {
|
|
1784
|
+
const $ = literal2.slice(3, length);
|
|
1785
|
+
ESCAPED_EXCLUDE_CONTROL_CHARACTER_test($) || throws(SyntaxError$1(`Bad multi-line basic string` + where(" at ")));
|
|
1786
|
+
const value = BasicString($) + (literal2.startsWith('"', length += 3) ? literal2.startsWith('"', ++length) ? (++length, '""') : '"' : "");
|
|
1787
|
+
table[finalKey] = preserveLiteral ? LiteralObject(literal2.slice(0, length), value) : value;
|
|
1788
|
+
return literal2.slice(length).replace(PRE_WHITESPACE, "");
|
|
1789
|
+
}
|
|
1790
|
+
const start = new mark("Multi-line Basic String", length);
|
|
1791
|
+
const skipped = (literal2 = literal2.slice(3)) ? 0 : 1;
|
|
1792
|
+
if (skipped) {
|
|
1793
|
+
literal2 = start.must();
|
|
1794
|
+
let length2 = MULTI_LINE_BASIC_STRING_exec_0_length(literal2);
|
|
1795
|
+
if (literal2.length !== length2) {
|
|
1796
|
+
const $ = literal2.slice(0, length2);
|
|
1797
|
+
ESCAPED_EXCLUDE_CONTROL_CHARACTER_test($) || throws(SyntaxError$1(`Bad multi-line basic string` + where(" at ")));
|
|
1798
|
+
const value = MultilineBasicString($, useWhatToJoinMultilineString, skipped) + (literal2.startsWith('"', length2 += 3) ? literal2.startsWith('"', ++length2) ? (++length2, '""') : '"' : "");
|
|
1799
|
+
table[finalKey] = preserveLiteral ? LiteralObject(['"""', literal2.slice(0, length2)], value) : value;
|
|
1800
|
+
return literal2.slice(length2).replace(PRE_WHITESPACE, "");
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
useWhatToJoinMultilineString === null && start.nowrap(ARGS_MODE);
|
|
1804
|
+
ESCAPED_EXCLUDE_CONTROL_CHARACTER_test(literal2 + "\n") || throws(SyntaxError$1(`Bad multi-line basic string` + where(" at ")));
|
|
1805
|
+
for (const lines = [literal2]; ; ) {
|
|
1806
|
+
const line = start.must();
|
|
1807
|
+
let length2 = MULTI_LINE_BASIC_STRING_exec_0_length(line);
|
|
1808
|
+
if (line.length !== length2) {
|
|
1809
|
+
const $ = line.slice(0, length2);
|
|
1810
|
+
ESCAPED_EXCLUDE_CONTROL_CHARACTER_test($) || throws(SyntaxError$1(`Bad multi-line basic string` + where(" at ")));
|
|
1811
|
+
const value = MultilineBasicString(lines.join("\n") + "\n" + $, useWhatToJoinMultilineString, skipped) + (line.startsWith('"', length2 += 3) ? line.startsWith('"', ++length2) ? (++length2, '""') : '"' : "");
|
|
1812
|
+
if (preserveLiteral) {
|
|
1813
|
+
skipped ? lines.unshift('"""') : lines[0] = `"""${literal2}`;
|
|
1814
|
+
lines[lines.length] = `${$}"""`;
|
|
1815
|
+
table[finalKey] = LiteralObject(lines, value);
|
|
1816
|
+
} else {
|
|
1817
|
+
table[finalKey] = value;
|
|
1818
|
+
}
|
|
1819
|
+
return line.slice(length2).replace(PRE_WHITESPACE, "");
|
|
1820
|
+
}
|
|
1821
|
+
ESCAPED_EXCLUDE_CONTROL_CHARACTER_test(line + "\n") || throws(SyntaxError$1(`Bad multi-line basic string` + where(" at ")));
|
|
1822
|
+
lines[lines.length] = line;
|
|
1823
|
+
}
|
|
1824
|
+
};
|
|
1825
|
+
var KEYS = /* @__PURE__ */ Null$1(null);
|
|
1826
|
+
var commentFor = (key) => KEYS[key] || (KEYS[key] = Symbol$1(key));
|
|
1827
|
+
var commentForThis = Symbol$1("this");
|
|
1828
|
+
var { test: includesNewline } = theRegExp(/\r?\n/g);
|
|
1829
|
+
var getCOMMENT = (table, keyComment) => {
|
|
1830
|
+
if (keyComment in table) {
|
|
1831
|
+
const comment = table[keyComment];
|
|
1832
|
+
if (typeof comment !== "string") {
|
|
1833
|
+
throw TypeError$1(`the value of comment must be a string, while "${comment === null ? "null" : typeof comment}" type is found`);
|
|
1834
|
+
}
|
|
1835
|
+
if (includesNewline(comment)) {
|
|
1836
|
+
throw SyntaxError$1(`the value of comment must be a string and can not include newline`);
|
|
1837
|
+
}
|
|
1838
|
+
return ` #${comment}`;
|
|
1839
|
+
}
|
|
1840
|
+
return "";
|
|
1841
|
+
};
|
|
1842
|
+
var getComment = (table, key) => key in KEYS ? getCOMMENT(table, KEYS[key]) : "";
|
|
1843
|
+
var { test: IS_OFFSET$ } = theRegExp(OFFSET$);
|
|
1844
|
+
var { test: IS_EMPTY } = theRegExp(/^\[[\t ]*]/);
|
|
1845
|
+
var parseKeys = (rest2) => {
|
|
1846
|
+
let lineRest = rest2;
|
|
1847
|
+
const leadingKeys = [];
|
|
1848
|
+
let lastIndex = -1;
|
|
1849
|
+
for (; ; ) {
|
|
1850
|
+
lineRest || throws(SyntaxError$1(`Empty bare key` + where(" at ")));
|
|
1851
|
+
if (lineRest[0] === '"') {
|
|
1852
|
+
const index = BASIC_STRING_exec_1_endIndex(lineRest);
|
|
1853
|
+
KEYS$1.test(leadingKeys[++lastIndex] = BasicString(lineRest.slice(1, index))) || throws(Error$1(`Key not allowed` + where(" at ")));
|
|
1854
|
+
lineRest = lineRest.slice(index + 1);
|
|
1855
|
+
} else {
|
|
1856
|
+
const isQuoted = lineRest[0] === "'";
|
|
1857
|
+
const key = ((isQuoted ? __LITERAL_KEY_exec : __BARE_KEY_exec)(lineRest) || throws(SyntaxError$1(`Bad ${isQuoted ? "literal string" : "bare"} key` + where(" at "))))[0];
|
|
1858
|
+
lineRest = lineRest.slice(key.length);
|
|
1859
|
+
KEYS$1.test(leadingKeys[++lastIndex] = isQuoted ? key.slice(1, -1) : key) || throws(Error$1(`Key not allowed` + where(" at ")));
|
|
1860
|
+
}
|
|
1861
|
+
if (IS_DOT_KEY(lineRest)) {
|
|
1862
|
+
lineRest = lineRest.replace(DOT_KEY, "");
|
|
1863
|
+
} else {
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (disableDigit) {
|
|
1868
|
+
const keys2 = rest2.slice(0, -lineRest.length);
|
|
1869
|
+
(isAmazing(keys2) || enableNull && keys2 === "null") && throws(SyntaxError$1(`Bad bare key disabled by xOptions.string` + where(" at ")));
|
|
1870
|
+
}
|
|
1871
|
+
if (disallowEmptyKey) {
|
|
1872
|
+
let index = lastIndex;
|
|
1873
|
+
do {
|
|
1874
|
+
leadingKeys[index] || throws(SyntaxError$1(`Empty key is not allowed before TOML v0.5` + where(", which at ")));
|
|
1875
|
+
} while (index--);
|
|
1876
|
+
}
|
|
1877
|
+
const finalKey = leadingKeys[lastIndex];
|
|
1878
|
+
leadingKeys.length = lastIndex;
|
|
1879
|
+
return { leadingKeys, finalKey, lineRest };
|
|
1880
|
+
};
|
|
1881
|
+
var push = (lastArray, lineRest) => {
|
|
1882
|
+
if (lineRest[0] === "<") {
|
|
1883
|
+
const { 1: tag } = { 2: lineRest } = _VALUE_PAIR_exec(lineRest) || throws(SyntaxError$1(`Bad tag ` + where(" at ")));
|
|
1884
|
+
collect(tag, lastArray, null);
|
|
1885
|
+
switch (lineRest && lineRest[0]) {
|
|
1886
|
+
case ",":
|
|
1887
|
+
case "]":
|
|
1888
|
+
case "":
|
|
1889
|
+
case "#":
|
|
1890
|
+
lastArray[lastArray.length] = undefined$1;
|
|
1891
|
+
return lineRest;
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
switch (lineRest[0]) {
|
|
1895
|
+
case "'":
|
|
1896
|
+
return assignLiteralString(asStrings(lastArray), lastArray.length, lineRest);
|
|
1897
|
+
case '"':
|
|
1898
|
+
return assignBasicString(asStrings(lastArray), lastArray.length, lineRest);
|
|
1899
|
+
case "{":
|
|
1900
|
+
inlineTable || throws(SyntaxError$1(`Inline Table is not allowed before TOML v0.4` + where(", which at ")));
|
|
1901
|
+
return equalInlineTable(asTables(lastArray), lastArray.length, lineRest);
|
|
1902
|
+
case "[":
|
|
1903
|
+
return equalStaticArray(asArrays(lastArray), lastArray.length, lineRest);
|
|
1904
|
+
}
|
|
1905
|
+
const { 1: literal2 } = { 2: lineRest } = VALUE_REST_exec(lineRest) || throws(SyntaxError$1(`Bad atom value` + where(" at ")));
|
|
1906
|
+
if (literal2 === "true") {
|
|
1907
|
+
asBooleans(lastArray)[lastArray.length] = true;
|
|
1908
|
+
} else if (literal2 === "false") {
|
|
1909
|
+
asBooleans(lastArray)[lastArray.length] = false;
|
|
1910
|
+
} else if (enableNull && literal2 === "null") {
|
|
1911
|
+
asNulls(lastArray)[lastArray.length] = null;
|
|
1912
|
+
} else if (literal2.includes(":")) {
|
|
1913
|
+
if (literal2.includes("-")) {
|
|
1914
|
+
if (IS_OFFSET$(literal2)) {
|
|
1915
|
+
asOffsetDateTimes(lastArray)[lastArray.length] = new OffsetDateTime(literal2);
|
|
1916
|
+
} else {
|
|
1917
|
+
moreDatetime || throws(SyntaxError$1(`Local Date-Time is not allowed before TOML v0.5` + where(", which at ")));
|
|
1918
|
+
asLocalDateTimes(lastArray)[lastArray.length] = new LocalDateTime(literal2);
|
|
1919
|
+
}
|
|
1920
|
+
} else {
|
|
1921
|
+
moreDatetime || throws(SyntaxError$1(`Local Time is not allowed before TOML v0.5` + where(", which at ")));
|
|
1922
|
+
asLocalTimes(lastArray)[lastArray.length] = new LocalTime(literal2);
|
|
1923
|
+
}
|
|
1924
|
+
} else if (literal2.indexOf("-") !== literal2.lastIndexOf("-") && literal2[0] !== "-") {
|
|
1925
|
+
moreDatetime || throws(SyntaxError$1(`Local Date is not allowed before TOML v0.5` + where(", which at ")));
|
|
1926
|
+
asLocalDates(lastArray)[lastArray.length] = new LocalDate(literal2);
|
|
1927
|
+
} else {
|
|
1928
|
+
literal2.includes(".") || literal2.includes("n") || (literal2.includes("e") || literal2.includes("E")) && !literal2.startsWith("0x") ? asFloats(lastArray)[lastArray.length] = preserveLiteral ? LiteralObject(literal2, Float(literal2)) : Float(literal2) : asIntegers(lastArray)[lastArray.length] = preserveLiteral ? LiteralObject(literal2, Integer(literal2)) : Integer(literal2);
|
|
1929
|
+
}
|
|
1930
|
+
return lineRest;
|
|
1931
|
+
};
|
|
1932
|
+
var equalStaticArray = function* (table, finalKey, lineRest) {
|
|
1933
|
+
const staticArray = table[finalKey] = newArray(STATICALLY);
|
|
1934
|
+
if (IS_EMPTY(lineRest)) {
|
|
1935
|
+
beInline(staticArray, lineRest[1] === "]" ? 0 : 3);
|
|
1936
|
+
return lineRest.slice(lineRest.indexOf("]")).replace(SYM_WHITESPACE, "");
|
|
1937
|
+
}
|
|
1938
|
+
const start = new mark("Static Array", lineRest.length);
|
|
1939
|
+
let inline2 = lineRest.startsWith("[ ") || lineRest.startsWith("[ ") ? 3 : 0;
|
|
1940
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "");
|
|
1941
|
+
while (!lineRest || lineRest[0] === "#") {
|
|
1942
|
+
inline2 = null;
|
|
1943
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
1944
|
+
}
|
|
1945
|
+
if (lineRest[0] === "]") {
|
|
1946
|
+
inline2 === null || beInline(staticArray, inline2);
|
|
1947
|
+
return lineRest.replace(SYM_WHITESPACE, "");
|
|
1948
|
+
}
|
|
1949
|
+
for (; ; ) {
|
|
1950
|
+
const rest2 = push(staticArray, lineRest);
|
|
1951
|
+
lineRest = typeof rest2 === "string" ? rest2 : yield rest2;
|
|
1952
|
+
while (!lineRest || lineRest[0] === "#") {
|
|
1953
|
+
inline2 = null;
|
|
1954
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
1955
|
+
}
|
|
1956
|
+
if (lineRest[0] === ",") {
|
|
1957
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "");
|
|
1958
|
+
while (!lineRest || lineRest[0] === "#") {
|
|
1959
|
+
inline2 = null;
|
|
1960
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
1961
|
+
}
|
|
1962
|
+
if (lineRest[0] === "]") {
|
|
1963
|
+
break;
|
|
1964
|
+
}
|
|
1965
|
+
} else {
|
|
1966
|
+
if (lineRest[0] === "]") {
|
|
1967
|
+
break;
|
|
1968
|
+
}
|
|
1969
|
+
throw throws(SyntaxError$1(`Unexpect character in static array item value` + where(", which is found at ")));
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
inline2 === null || beInline(staticArray, inline2);
|
|
1973
|
+
return lineRest.replace(SYM_WHITESPACE, "");
|
|
1974
|
+
};
|
|
1975
|
+
var equalInlineTable = function* (table, finalKey, lineRest) {
|
|
1976
|
+
const inlineTable2 = table[finalKey] = new Table3(DIRECTLY, INLINE);
|
|
1977
|
+
if (allowInlineTableMultilineAndTrailingCommaEvenNoComma) {
|
|
1978
|
+
const start = new mark("Inline Table", lineRest.length);
|
|
1979
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "");
|
|
1980
|
+
let inline2 = true;
|
|
1981
|
+
for (; ; ) {
|
|
1982
|
+
while (!lineRest || lineRest[0] === "#") {
|
|
1983
|
+
inline2 = false;
|
|
1984
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
1985
|
+
}
|
|
1986
|
+
if (lineRest[0] === "}") {
|
|
1987
|
+
break;
|
|
1988
|
+
}
|
|
1989
|
+
const forComment = ForComment(inlineTable2, lineRest);
|
|
1990
|
+
const rest2 = assign(forComment);
|
|
1991
|
+
lineRest = typeof rest2 === "string" ? rest2 : yield rest2;
|
|
1992
|
+
if (lineRest) {
|
|
1993
|
+
if (lineRest[0] === "#") {
|
|
1994
|
+
if (preserveComment) {
|
|
1995
|
+
forComment.table[commentFor(forComment.finalKey)] = lineRest.slice(1);
|
|
1996
|
+
}
|
|
1997
|
+
inline2 = false;
|
|
1998
|
+
do {
|
|
1999
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
2000
|
+
} while (!lineRest || lineRest[0] === "#");
|
|
2001
|
+
}
|
|
2002
|
+
} else {
|
|
2003
|
+
inline2 = false;
|
|
2004
|
+
do {
|
|
2005
|
+
lineRest = start.must().replace(PRE_WHITESPACE, "");
|
|
2006
|
+
} while (!lineRest || lineRest[0] === "#");
|
|
2007
|
+
}
|
|
2008
|
+
if (lineRest[0] === ",") {
|
|
2009
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "");
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
inline2 || beInline(inlineTable2, false);
|
|
2013
|
+
} else {
|
|
2014
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "") || throws(SyntaxError$1(`Inline Table is intended to appear on a single line` + where(", which broken at ")));
|
|
2015
|
+
if (lineRest[0] !== "}") {
|
|
2016
|
+
for (; ; ) {
|
|
2017
|
+
lineRest[0] === "#" && throws(SyntaxError$1(`Inline Table is intended to appear on a single line` + where(", which broken at ")));
|
|
2018
|
+
const rest2 = assign(ForComment(inlineTable2, lineRest));
|
|
2019
|
+
lineRest = (typeof rest2 === "string" ? rest2 : yield rest2) || throws(SyntaxError$1(`Inline Table is intended to appear on a single line` + where(", which broken at ")));
|
|
2020
|
+
if (lineRest[0] === "}") {
|
|
2021
|
+
break;
|
|
2022
|
+
}
|
|
2023
|
+
if (lineRest[0] === ",") {
|
|
2024
|
+
lineRest = lineRest.replace(SYM_WHITESPACE, "") || throws(SyntaxError$1(`Inline Table is intended to appear on a single line` + where(", which broken at ")));
|
|
2025
|
+
lineRest[0] === "}" && throws(SyntaxError$1(`The last property of an Inline Table can not have a trailing comma` + where(", which was found at ")));
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
return lineRest.replace(SYM_WHITESPACE, "");
|
|
2031
|
+
};
|
|
2032
|
+
var ForComment = (lastInlineTable, lineRest) => {
|
|
2033
|
+
const { leadingKeys, finalKey, tag } = { lineRest } = KEY_VALUE_PAIR_exec_groups(parseKeys(lineRest));
|
|
2034
|
+
return { table: prepareInlineTable(lastInlineTable, leadingKeys), finalKey, tag, lineRest };
|
|
2035
|
+
};
|
|
2036
|
+
var assign = ({ finalKey, tag, lineRest, table }) => {
|
|
2037
|
+
finalKey in table && throws(Error$1(`Duplicate property definition` + where(" at ")));
|
|
2038
|
+
if (tag) {
|
|
2039
|
+
collect(tag, null, table, finalKey);
|
|
2040
|
+
switch (lineRest && lineRest[0]) {
|
|
2041
|
+
case ",":
|
|
2042
|
+
case "}":
|
|
2043
|
+
case "":
|
|
2044
|
+
case "#":
|
|
2045
|
+
table[finalKey] = undefined$1;
|
|
2046
|
+
return lineRest;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
switch (lineRest && lineRest[0]) {
|
|
2050
|
+
case "'":
|
|
2051
|
+
return assignLiteralString(table, finalKey, lineRest);
|
|
2052
|
+
case '"':
|
|
2053
|
+
return assignBasicString(table, finalKey, lineRest);
|
|
2054
|
+
case "{":
|
|
2055
|
+
inlineTable || throws(SyntaxError$1(`Inline Table is not allowed before TOML v0.4` + where(", which at ")));
|
|
2056
|
+
return equalInlineTable(table, finalKey, lineRest);
|
|
2057
|
+
case "[":
|
|
2058
|
+
return equalStaticArray(table, finalKey, lineRest);
|
|
2059
|
+
}
|
|
2060
|
+
const { 1: literal2 } = { 2: lineRest } = VALUE_REST_exec(lineRest) || throws(SyntaxError$1(`Bad atom value` + where(" at ")));
|
|
2061
|
+
if (literal2 === "true") {
|
|
2062
|
+
table[finalKey] = true;
|
|
2063
|
+
} else if (literal2 === "false") {
|
|
2064
|
+
table[finalKey] = false;
|
|
2065
|
+
} else if (enableNull && literal2 === "null") {
|
|
2066
|
+
table[finalKey] = null;
|
|
2067
|
+
} else if (literal2.includes(":")) {
|
|
2068
|
+
if (literal2.includes("-")) {
|
|
2069
|
+
if (IS_OFFSET$(literal2)) {
|
|
2070
|
+
table[finalKey] = new OffsetDateTime(literal2);
|
|
2071
|
+
} else {
|
|
2072
|
+
moreDatetime || throws(SyntaxError$1(`Local Date-Time is not allowed before TOML v0.5` + where(", which at ")));
|
|
2073
|
+
table[finalKey] = new LocalDateTime(literal2);
|
|
2074
|
+
}
|
|
2075
|
+
} else {
|
|
2076
|
+
moreDatetime || throws(SyntaxError$1(`Local Time is not allowed before TOML v0.5` + where(", which at ")));
|
|
2077
|
+
table[finalKey] = new LocalTime(literal2);
|
|
2078
|
+
}
|
|
2079
|
+
} else if (literal2.indexOf("-") !== literal2.lastIndexOf("-") && literal2[0] !== "-") {
|
|
2080
|
+
moreDatetime || throws(SyntaxError$1(`Local Date is not allowed before TOML v0.5` + where(", which at ")));
|
|
2081
|
+
table[finalKey] = new LocalDate(literal2);
|
|
2082
|
+
} else {
|
|
2083
|
+
table[finalKey] = literal2.includes(".") || literal2.includes("n") || (literal2.includes("e") || literal2.includes("E")) && !literal2.startsWith("0x") ? preserveLiteral ? LiteralObject(literal2, Float(literal2)) : Float(literal2) : preserveLiteral ? LiteralObject(literal2, Integer(literal2)) : Integer(literal2);
|
|
2084
|
+
}
|
|
2085
|
+
return lineRest;
|
|
2086
|
+
};
|
|
2087
|
+
var Root = () => {
|
|
2088
|
+
const rootTable = new Table3();
|
|
2089
|
+
let lastSectionTable = rootTable;
|
|
2090
|
+
while (rest()) {
|
|
2091
|
+
const line = next().replace(PRE_WHITESPACE, "");
|
|
2092
|
+
if (line) {
|
|
2093
|
+
if (line[0] === "[") {
|
|
2094
|
+
const { leadingKeys, finalKey, asArrayItem, tag, lineRest } = TABLE_DEFINITION_exec_groups(line, parseKeys);
|
|
2095
|
+
const table = prepareTable(rootTable, leadingKeys);
|
|
2096
|
+
if (lineRest) {
|
|
2097
|
+
lineRest[0] === "#" || throws(SyntaxError$1(`Unexpect charachtor after table header` + where(" at ")));
|
|
2098
|
+
}
|
|
2099
|
+
lastSectionTable = appendTable(table, finalKey, asArrayItem, tag);
|
|
2100
|
+
preserveComment && lineRest && (lastSectionTable[commentForThis] = asArrayItem ? lineRest.slice(1) : table[commentFor(finalKey)] = lineRest.slice(1));
|
|
2101
|
+
} else if (line[0] === "#") {
|
|
2102
|
+
__CONTROL_CHARACTER_EXCLUDE_test(line) && throws(SyntaxError$1(`Control characters other than Tab are not permitted in comments` + where(", which was found at ")));
|
|
2103
|
+
} else {
|
|
2104
|
+
const forComment = ForComment(lastSectionTable, line);
|
|
2105
|
+
let rest2 = assign(forComment);
|
|
2106
|
+
typeof rest2 === "string" || (rest2 = x(rest2));
|
|
2107
|
+
if (rest2) {
|
|
2108
|
+
rest2[0] === "#" || throws(SyntaxError$1(`Unexpect charachtor after key/value pair` + where(" at ")));
|
|
2109
|
+
if (preserveComment) {
|
|
2110
|
+
forComment.table[commentFor(forComment.finalKey)] = rest2.slice(1);
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
return rootTable;
|
|
2117
|
+
};
|
|
2118
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
2119
|
+
var DATE = Date.prototype;
|
|
2120
|
+
var valueOf$2 = String.prototype.valueOf;
|
|
2121
|
+
var isString = (
|
|
2122
|
+
/* j-globals: class.isString (internal) */
|
|
2123
|
+
/* @__PURE__ */ function() {
|
|
2124
|
+
if (apply.bind) {
|
|
2125
|
+
var valueOf_apply = apply.bind(valueOf$2);
|
|
2126
|
+
return function isString2(value) {
|
|
2127
|
+
try {
|
|
2128
|
+
valueOf_apply(value);
|
|
2129
|
+
} catch (error) {
|
|
2130
|
+
return false;
|
|
2131
|
+
}
|
|
2132
|
+
return true;
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
return function isString2(value) {
|
|
2136
|
+
try {
|
|
2137
|
+
valueOf$2.apply(value);
|
|
2138
|
+
} catch (error) {
|
|
2139
|
+
return false;
|
|
2140
|
+
}
|
|
2141
|
+
return true;
|
|
2142
|
+
};
|
|
2143
|
+
}()
|
|
2144
|
+
);
|
|
2145
|
+
var valueOf$1 = Number.prototype.valueOf;
|
|
2146
|
+
var isNumber = (
|
|
2147
|
+
/* j-globals: class.isNumber (internal) */
|
|
2148
|
+
/* @__PURE__ */ function() {
|
|
2149
|
+
if (apply.bind) {
|
|
2150
|
+
var valueOf_apply = apply.bind(valueOf$1);
|
|
2151
|
+
return function isNumber2(value) {
|
|
2152
|
+
try {
|
|
2153
|
+
valueOf_apply(value);
|
|
2154
|
+
} catch (error) {
|
|
2155
|
+
return false;
|
|
2156
|
+
}
|
|
2157
|
+
return true;
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
return function isNumber2(value) {
|
|
2161
|
+
try {
|
|
2162
|
+
valueOf$1.apply(value);
|
|
2163
|
+
} catch (error) {
|
|
2164
|
+
return false;
|
|
2165
|
+
}
|
|
2166
|
+
return true;
|
|
2167
|
+
};
|
|
2168
|
+
}()
|
|
2169
|
+
);
|
|
2170
|
+
var isBigInt = (
|
|
2171
|
+
/* j-globals: class.isBigInt (internal) */
|
|
2172
|
+
/* @__PURE__ */ function() {
|
|
2173
|
+
if (typeof BigInt === "function") {
|
|
2174
|
+
var valueOf_apply = apply.bind(BigInt.prototype.valueOf);
|
|
2175
|
+
return function isBigInt2(value) {
|
|
2176
|
+
try {
|
|
2177
|
+
valueOf_apply(value);
|
|
2178
|
+
} catch (error) {
|
|
2179
|
+
return false;
|
|
2180
|
+
}
|
|
2181
|
+
return true;
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
return function isBigInt2() {
|
|
2185
|
+
return false;
|
|
2186
|
+
};
|
|
2187
|
+
}()
|
|
2188
|
+
);
|
|
2189
|
+
var valueOf = BigInt.prototype.valueOf;
|
|
2190
|
+
var isBoolean = (
|
|
2191
|
+
/* j-globals: class.isBoolean (internal) */
|
|
2192
|
+
/* @__PURE__ */ function() {
|
|
2193
|
+
if (apply.bind) {
|
|
2194
|
+
var valueOf_apply = apply.bind(valueOf);
|
|
2195
|
+
return function isBoolean2(value) {
|
|
2196
|
+
try {
|
|
2197
|
+
valueOf_apply(value);
|
|
2198
|
+
} catch (error) {
|
|
2199
|
+
return false;
|
|
2200
|
+
}
|
|
2201
|
+
return true;
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
return function isBoolean2(value) {
|
|
2205
|
+
try {
|
|
2206
|
+
valueOf.apply(value);
|
|
2207
|
+
} catch (error) {
|
|
2208
|
+
return false;
|
|
2209
|
+
}
|
|
2210
|
+
return true;
|
|
2211
|
+
};
|
|
2212
|
+
}()
|
|
2213
|
+
);
|
|
2214
|
+
var ESCAPED = /* @__PURE__ */ Null$1({
|
|
2215
|
+
.../* @__PURE__ */ fromEntries(/* @__PURE__ */ [...Array$1(32)].map((_, charCode) => [fromCharCode(charCode), "\\u" + charCode.toString(16).toUpperCase().padStart(4, "0")])),
|
|
2216
|
+
"\b": "\\b",
|
|
2217
|
+
" ": "\\t",
|
|
2218
|
+
"\n": "\\n",
|
|
2219
|
+
"\f": "\\f",
|
|
2220
|
+
"\r": "\\r",
|
|
2221
|
+
'"': '\\"',
|
|
2222
|
+
'"""': '""\\"',
|
|
2223
|
+
"\\": "\\\\",
|
|
2224
|
+
"\x7F": "\\u007F"
|
|
2225
|
+
});
|
|
2226
|
+
var { test: NEED_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F'\x7F]/);
|
|
2227
|
+
var BY_ESCAPE = /[^\x00-\x08\x0A-\x1F"\\\x7F]+|./gs;
|
|
2228
|
+
var { test: NEED_ESCAPE } = theRegExp(/^[\x00-\x08\x0A-\x1F"\\\x7F]/);
|
|
2229
|
+
var singlelineString = (value) => {
|
|
2230
|
+
if (NEED_BASIC(value)) {
|
|
2231
|
+
const parts = value.match(BY_ESCAPE);
|
|
2232
|
+
let index = parts.length;
|
|
2233
|
+
do {
|
|
2234
|
+
if (NEED_ESCAPE(parts[--index])) {
|
|
2235
|
+
parts[index] = ESCAPED[parts[index]];
|
|
2236
|
+
}
|
|
2237
|
+
} while (index);
|
|
2238
|
+
return `"${parts.join("")}"`;
|
|
2239
|
+
}
|
|
2240
|
+
return `'${value}'`;
|
|
2241
|
+
};
|
|
2242
|
+
var singlelineBasicString = (value) => {
|
|
2243
|
+
if (value) {
|
|
2244
|
+
const parts = value.match(BY_ESCAPE);
|
|
2245
|
+
let index = parts.length;
|
|
2246
|
+
do {
|
|
2247
|
+
if (NEED_ESCAPE(parts[--index])) {
|
|
2248
|
+
parts[index] = ESCAPED[parts[index]];
|
|
2249
|
+
}
|
|
2250
|
+
} while (index);
|
|
2251
|
+
return `"${parts.join("")}"`;
|
|
2252
|
+
}
|
|
2253
|
+
return `""`;
|
|
2254
|
+
};
|
|
2255
|
+
var { test: NEED_MULTILINE_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F\x7F]|'''/);
|
|
2256
|
+
var { test: multilineNeedBasic } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]|'''/);
|
|
2257
|
+
var { test: REAL_MULTILINE_ESCAPE } = theRegExp(/[\x00-\x08\x0A-\x1F\\\x7F]|"""/);
|
|
2258
|
+
var BY_MULTILINE_ESCAPE = /[^\x00-\x08\x0A-\x1F"\\\x7F]+|"""|./gs;
|
|
2259
|
+
var { test: NEED_MULTILINE_ESCAPE } = theRegExp(/^(?:[\x00-\x08\x0A-\x1F\\\x7F]|""")/);
|
|
2260
|
+
var escape_multiline = (lines, lineIndex2) => {
|
|
2261
|
+
const line = lines[lineIndex2];
|
|
2262
|
+
if (REAL_MULTILINE_ESCAPE(line)) {
|
|
2263
|
+
const parts = line.match(BY_MULTILINE_ESCAPE);
|
|
2264
|
+
let index = parts.length;
|
|
2265
|
+
do {
|
|
2266
|
+
if (NEED_MULTILINE_ESCAPE(parts[--index])) {
|
|
2267
|
+
parts[index] = ESCAPED[parts[index]];
|
|
2268
|
+
}
|
|
2269
|
+
} while (index);
|
|
2270
|
+
lines[lineIndex2] = parts.join("");
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
var Lines = (lines) => (lines = ["", ...lines]).length === 1 ? ["", ""] : lines;
|
|
2274
|
+
var multilineString = (lines) => {
|
|
2275
|
+
const lastIndex = lines.length - 1;
|
|
2276
|
+
let index = lastIndex;
|
|
2277
|
+
do {
|
|
2278
|
+
if (NEED_MULTILINE_BASIC(lines[index])) {
|
|
2279
|
+
break;
|
|
2280
|
+
}
|
|
2281
|
+
} while (--index);
|
|
2282
|
+
if (index) {
|
|
2283
|
+
index = lastIndex;
|
|
2284
|
+
escape_multiline(lines, index);
|
|
2285
|
+
lines[index] += lines[0] = '"""';
|
|
2286
|
+
while (--index) {
|
|
2287
|
+
escape_multiline(lines, index);
|
|
2288
|
+
}
|
|
2289
|
+
} else {
|
|
2290
|
+
lines[lastIndex] += lines[0] = "'''";
|
|
2291
|
+
}
|
|
2292
|
+
return lines;
|
|
2293
|
+
};
|
|
2294
|
+
var multilineBasicString = (lines) => {
|
|
2295
|
+
let index = lines.length - 1;
|
|
2296
|
+
escape_multiline(lines, index);
|
|
2297
|
+
lines[index] += lines[0] = '"""';
|
|
2298
|
+
while (--index) {
|
|
2299
|
+
escape_multiline(lines, index);
|
|
2300
|
+
}
|
|
2301
|
+
return lines;
|
|
2302
|
+
};
|
|
2303
|
+
var multilineLiteralString = (lines) => {
|
|
2304
|
+
lines[lines.length - 1] += lines[0] = "'''";
|
|
2305
|
+
return lines;
|
|
2306
|
+
};
|
|
2307
|
+
var Float64Array$1 = Float64Array;
|
|
2308
|
+
var Uint8Array$1 = Uint8Array;
|
|
2309
|
+
var _Infinity = -Infinity;
|
|
2310
|
+
var { test: INTEGER_LIKE } = theRegExp(/^-?\d+$/);
|
|
2311
|
+
var ensureFloat = (literal2) => INTEGER_LIKE(literal2) ? literal2 + ".0" : literal2;
|
|
2312
|
+
var float64Array = new Float64Array$1([NaN$1]);
|
|
2313
|
+
var uint8Array = new Uint8Array$1(float64Array.buffer);
|
|
2314
|
+
var NaN_7 = uint8Array[7];
|
|
2315
|
+
var float = NaN_7 === new Uint8Array$1(new Float64Array$1([-NaN$1]).buffer)[7] ? (value) => value ? value === Infinity ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : "nan" : (value) => value ? value === Infinity ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : (float64Array[0] = value, uint8Array[7]) === NaN_7 ? "nan" : "-nan";
|
|
2316
|
+
var isDate = /* @__PURE__ */ isPrototypeOf.bind(DATE);
|
|
2317
|
+
var { test: BARE } = theRegExp(/^[\w-]+$/);
|
|
2318
|
+
var $Key$ = (key) => BARE(key) ? key : singlelineString(key);
|
|
2319
|
+
var FIRST = /[^.]+/;
|
|
2320
|
+
var literalString = (value) => `'${value}'`;
|
|
2321
|
+
var $Keys = (keys2) => isAmazing(keys2) ? keys2.replace(FIRST, literalString) : keys2 === "null" ? `'null'` : keys2;
|
|
2322
|
+
var TOMLSection = class extends Array$1 {
|
|
2323
|
+
document;
|
|
2324
|
+
constructor(document) {
|
|
2325
|
+
super();
|
|
2326
|
+
this.document = document;
|
|
2327
|
+
return this;
|
|
2328
|
+
}
|
|
2329
|
+
[Symbol$1.toPrimitive]() {
|
|
2330
|
+
return this.join(this.document.newline);
|
|
2331
|
+
}
|
|
2332
|
+
appendNewline() {
|
|
2333
|
+
this[this.length] = "";
|
|
2334
|
+
}
|
|
2335
|
+
set appendLine(source) {
|
|
2336
|
+
this[this.length] = source;
|
|
2337
|
+
}
|
|
2338
|
+
set appendInline(source) {
|
|
2339
|
+
this[this.length - 1] += source;
|
|
2340
|
+
}
|
|
2341
|
+
set appendInlineIf(source) {
|
|
2342
|
+
source && (this[this.length - 1] += source);
|
|
2343
|
+
}
|
|
2344
|
+
///
|
|
2345
|
+
*assignBlock(documentKeys_, sectionKeys_, table, tableKeys) {
|
|
2346
|
+
const { document } = this;
|
|
2347
|
+
const { newlineUnderHeader, newlineUnderSectionButPair } = document;
|
|
2348
|
+
const newlineAfterDotted = sectionKeys_ ? document.newlineUnderPairButDotted : false;
|
|
2349
|
+
const newlineAfterPair = sectionKeys_ ? document.newlineUnderDotted : document.newlineUnderPair;
|
|
2350
|
+
for (const tableKey of tableKeys) {
|
|
2351
|
+
const value = table[tableKey];
|
|
2352
|
+
const $key$ = $Key$(tableKey);
|
|
2353
|
+
const documentKeys = documentKeys_ + $key$;
|
|
2354
|
+
if (isArray$1(value)) {
|
|
2355
|
+
const { length } = value;
|
|
2356
|
+
if (length) {
|
|
2357
|
+
let firstItem = value[0];
|
|
2358
|
+
if (isSection(firstItem)) {
|
|
2359
|
+
const tableHeader = `[[${documentKeys}]]`;
|
|
2360
|
+
const documentKeys_2 = documentKeys + ".";
|
|
2361
|
+
let index = 0;
|
|
2362
|
+
let table2 = firstItem;
|
|
2363
|
+
for (; ; ) {
|
|
2364
|
+
const section = document.appendSection();
|
|
2365
|
+
section[0] = tableHeader + getCOMMENT(table2, commentForThis);
|
|
2366
|
+
if (newlineUnderHeader) {
|
|
2367
|
+
section[1] = "";
|
|
2368
|
+
yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
|
|
2369
|
+
newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
|
|
2370
|
+
} else {
|
|
2371
|
+
yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
|
|
2372
|
+
newlineUnderSectionButPair && section.appendNewline();
|
|
2373
|
+
}
|
|
2374
|
+
if (++index === length) {
|
|
2375
|
+
break;
|
|
2376
|
+
}
|
|
2377
|
+
table2 = value[index];
|
|
2378
|
+
if (!isSection(table2)) {
|
|
2379
|
+
throw TypeError$1(`the first table item marked by Section() means the parent array is an array of tables, which can not include other types or table not marked by Section() any more in the rest items`);
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
continue;
|
|
2383
|
+
} else {
|
|
2384
|
+
let index = 1;
|
|
2385
|
+
while (index !== length) {
|
|
2386
|
+
if (isSection(value[index++])) {
|
|
2387
|
+
throw TypeError$1(`if an array is not array of tables, it can not include any table that marked by Section()`);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
} else {
|
|
2393
|
+
if (isSection(value)) {
|
|
2394
|
+
const section = document.appendSection();
|
|
2395
|
+
section[0] = `[${documentKeys}]${document.preferCommentForThis ? getCOMMENT(value, commentForThis) || getComment(table, tableKey) : getComment(table, tableKey) || getCOMMENT(value, commentForThis)}`;
|
|
2396
|
+
if (newlineUnderHeader) {
|
|
2397
|
+
section[1] = "";
|
|
2398
|
+
yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
|
|
2399
|
+
newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
|
|
2400
|
+
} else {
|
|
2401
|
+
yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
|
|
2402
|
+
newlineUnderSectionButPair && section.appendNewline();
|
|
2403
|
+
}
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
const sectionKeys = sectionKeys_ + $key$;
|
|
2408
|
+
this.appendLine = $Keys(sectionKeys) + " = ";
|
|
2409
|
+
const valueKeysIfValueIsDottedTable = this.value("", value, true);
|
|
2410
|
+
if (valueKeysIfValueIsDottedTable) {
|
|
2411
|
+
--this.length;
|
|
2412
|
+
yield this.assignBlock(documentKeys + ".", sectionKeys + ".", value, valueKeysIfValueIsDottedTable);
|
|
2413
|
+
newlineAfterDotted && this.appendNewline();
|
|
2414
|
+
} else {
|
|
2415
|
+
this.appendInlineIf = getComment(table, tableKey);
|
|
2416
|
+
newlineAfterPair && this.appendNewline();
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
value(indent, value, returnValueKeysIfValueIsDottedTable) {
|
|
2421
|
+
switch (typeof value) {
|
|
2422
|
+
case "object":
|
|
2423
|
+
if (value === null) {
|
|
2424
|
+
if (this.document.nullDisabled) {
|
|
2425
|
+
throw TypeError$1(`toml can not stringify "null" type value without truthy options.xNull`);
|
|
2426
|
+
}
|
|
2427
|
+
this.appendInline = "null";
|
|
2428
|
+
break;
|
|
2429
|
+
}
|
|
2430
|
+
const inlineMode = ofInline(value);
|
|
2431
|
+
if (isArray$1(value)) {
|
|
2432
|
+
if (inlineMode === undefined$1) {
|
|
2433
|
+
this.staticArray(indent, value);
|
|
2434
|
+
} else {
|
|
2435
|
+
const { $singlelineArray = inlineMode } = this.document;
|
|
2436
|
+
this.singlelineArray(indent, value, $singlelineArray);
|
|
2437
|
+
}
|
|
2438
|
+
break;
|
|
2439
|
+
}
|
|
2440
|
+
if (inlineMode !== undefined$1) {
|
|
2441
|
+
inlineMode || this.document.multilineTableDisabled ? this.inlineTable(indent, value) : this.multilineTable(indent, value, this.document.multilineTableComma);
|
|
2442
|
+
break;
|
|
2443
|
+
}
|
|
2444
|
+
if (isDate(value)) {
|
|
2445
|
+
this.appendInline = value.toISOString().replace("T", this.document.T).replace("Z", this.document.Z);
|
|
2446
|
+
break;
|
|
2447
|
+
}
|
|
2448
|
+
if (_literal in value) {
|
|
2449
|
+
const literal2 = value[_literal];
|
|
2450
|
+
if (typeof literal2 === "string") {
|
|
2451
|
+
this.appendInline = literal2;
|
|
2452
|
+
} else if (isArray$1(literal2)) {
|
|
2453
|
+
const { length } = literal2;
|
|
2454
|
+
if (length) {
|
|
2455
|
+
this.appendInline = literal2[0];
|
|
2456
|
+
let index = 1;
|
|
2457
|
+
while (index !== length) {
|
|
2458
|
+
this.appendLine = literal2[index++];
|
|
2459
|
+
}
|
|
2460
|
+
} else {
|
|
2461
|
+
throw TypeError$1(`literal value is broken`);
|
|
2462
|
+
}
|
|
2463
|
+
} else {
|
|
2464
|
+
throw TypeError$1(`literal value is broken`);
|
|
2465
|
+
}
|
|
2466
|
+
break;
|
|
2467
|
+
}
|
|
2468
|
+
if (isString(value)) {
|
|
2469
|
+
throw TypeError$1(`TOML.stringify refuse to handle [object String]`);
|
|
2470
|
+
}
|
|
2471
|
+
if (isNumber(value)) {
|
|
2472
|
+
throw TypeError$1(`TOML.stringify refuse to handle [object Number]`);
|
|
2473
|
+
}
|
|
2474
|
+
if (isBigInt(value)) {
|
|
2475
|
+
throw TypeError$1(`TOML.stringify refuse to handle [object BigInt]`);
|
|
2476
|
+
}
|
|
2477
|
+
if (isBoolean(value)) {
|
|
2478
|
+
throw TypeError$1(`TOML.stringify refuse to handle [object Boolean]`);
|
|
2479
|
+
}
|
|
2480
|
+
if (returnValueKeysIfValueIsDottedTable) {
|
|
2481
|
+
const keys2 = getOwnPropertyNames(value);
|
|
2482
|
+
if (keys2.length) {
|
|
2483
|
+
return keys2;
|
|
2484
|
+
}
|
|
2485
|
+
this.appendInline = "{ }";
|
|
2486
|
+
} else {
|
|
2487
|
+
this.inlineTable(indent, value);
|
|
2488
|
+
}
|
|
2489
|
+
break;
|
|
2490
|
+
case "bigint":
|
|
2491
|
+
this.appendInline = "" + value;
|
|
2492
|
+
break;
|
|
2493
|
+
case "number":
|
|
2494
|
+
this.appendInline = this.document.asInteger(value) ? is(value, -0) ? "-0" : "" + value : float(value);
|
|
2495
|
+
break;
|
|
2496
|
+
case "string":
|
|
2497
|
+
this.appendInline = singlelineString(value);
|
|
2498
|
+
break;
|
|
2499
|
+
case "boolean":
|
|
2500
|
+
this.appendInline = value ? "true" : "false";
|
|
2501
|
+
break;
|
|
2502
|
+
default:
|
|
2503
|
+
throw TypeError$1(`toml can not stringify "${typeof value}" type value`);
|
|
2504
|
+
}
|
|
2505
|
+
return null;
|
|
2506
|
+
}
|
|
2507
|
+
singlelineArray(indent, staticArray, inlineMode) {
|
|
2508
|
+
const { length } = staticArray;
|
|
2509
|
+
if (length) {
|
|
2510
|
+
this.appendInline = inlineMode & 2 ? "[ " : "[";
|
|
2511
|
+
this.value(indent, staticArray[0], false);
|
|
2512
|
+
let index = 1;
|
|
2513
|
+
while (index !== length) {
|
|
2514
|
+
this.appendInline = ", ";
|
|
2515
|
+
this.value(indent, staticArray[index++], false);
|
|
2516
|
+
}
|
|
2517
|
+
this.appendInline = inlineMode & 2 ? " ]" : "]";
|
|
2518
|
+
} else {
|
|
2519
|
+
this.appendInline = inlineMode & 1 ? "[ ]" : "[]";
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
staticArray(indent, staticArray) {
|
|
2523
|
+
this.appendInline = "[";
|
|
2524
|
+
const indent_ = indent + this.document.indent;
|
|
2525
|
+
const { length } = staticArray;
|
|
2526
|
+
let index = 0;
|
|
2527
|
+
while (index !== length) {
|
|
2528
|
+
this.appendLine = indent_;
|
|
2529
|
+
this.value(indent_, staticArray[index++], false);
|
|
2530
|
+
this.appendInline = ",";
|
|
2531
|
+
}
|
|
2532
|
+
this.appendLine = indent + "]";
|
|
2533
|
+
}
|
|
2534
|
+
inlineTable(indent, inlineTable2) {
|
|
2535
|
+
const keys2 = getOwnPropertyNames(inlineTable2);
|
|
2536
|
+
if (keys2.length) {
|
|
2537
|
+
this.appendInline = "{ ";
|
|
2538
|
+
this.assignInline(indent, inlineTable2, ``, keys2);
|
|
2539
|
+
this[this.length - 1] = this[this.length - 1].slice(0, -2) + " }";
|
|
2540
|
+
} else {
|
|
2541
|
+
this.appendInline = "{ }";
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
multilineTable(indent, inlineTable2, comma) {
|
|
2545
|
+
this.appendInline = "{";
|
|
2546
|
+
this.assignMultiline(indent, inlineTable2, ``, getOwnPropertyNames(inlineTable2), comma);
|
|
2547
|
+
this.appendLine = indent + "}";
|
|
2548
|
+
}
|
|
2549
|
+
assignInline(indent, inlineTable2, keys_, keys2) {
|
|
2550
|
+
for (const key of keys2) {
|
|
2551
|
+
const value = inlineTable2[key];
|
|
2552
|
+
const keys3 = keys_ + $Key$(key);
|
|
2553
|
+
const before_value = this.appendInline = $Keys(keys3) + " = ";
|
|
2554
|
+
const valueKeysIfValueIsDottedTable = this.value(indent, value, true);
|
|
2555
|
+
if (valueKeysIfValueIsDottedTable) {
|
|
2556
|
+
this[this.length - 1] = this[this.length - 1].slice(0, -before_value.length);
|
|
2557
|
+
this.assignInline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable);
|
|
2558
|
+
} else {
|
|
2559
|
+
this.appendInline = ", ";
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
assignMultiline(indent, inlineTable2, keys_, keys2, comma) {
|
|
2564
|
+
const indent_ = indent + this.document.indent;
|
|
2565
|
+
for (const key of keys2) {
|
|
2566
|
+
const value = inlineTable2[key];
|
|
2567
|
+
const keys3 = keys_ + $Key$(key);
|
|
2568
|
+
this.appendLine = indent_ + $Keys(keys3) + " = ";
|
|
2569
|
+
const valueKeysIfValueIsDottedTable = this.value(indent_, value, true);
|
|
2570
|
+
if (valueKeysIfValueIsDottedTable) {
|
|
2571
|
+
--this.length;
|
|
2572
|
+
this.assignMultiline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable, comma);
|
|
2573
|
+
} else {
|
|
2574
|
+
comma ? this.appendInline = "," + getComment(inlineTable2, key) : this.appendInlineIf = getComment(inlineTable2, key);
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
};
|
|
2579
|
+
var name2code = /* @__PURE__ */ Null$1({
|
|
2580
|
+
document: 0,
|
|
2581
|
+
section: 1,
|
|
2582
|
+
header: 2,
|
|
2583
|
+
pairs: 3,
|
|
2584
|
+
pair: 4
|
|
2585
|
+
});
|
|
2586
|
+
var { test: IS_INDENT } = theRegExp(/^[\t ]*$/);
|
|
2587
|
+
var return_false = () => false;
|
|
2588
|
+
var TOMLDocument = class extends Array$1 {
|
|
2589
|
+
get ["constructor"]() {
|
|
2590
|
+
return Array$1;
|
|
2591
|
+
}
|
|
2592
|
+
0 = new TOMLSection(this);
|
|
2593
|
+
asInteger = return_false;
|
|
2594
|
+
newline = "";
|
|
2595
|
+
newlineUnderSection = true;
|
|
2596
|
+
newlineUnderSectionButPair = true;
|
|
2597
|
+
newlineUnderHeader = true;
|
|
2598
|
+
newlineUnderPair = false;
|
|
2599
|
+
newlineUnderPairButDotted = false;
|
|
2600
|
+
newlineUnderDotted = false;
|
|
2601
|
+
indent = " ";
|
|
2602
|
+
T = "T";
|
|
2603
|
+
Z = "Z";
|
|
2604
|
+
nullDisabled = true;
|
|
2605
|
+
multilineTableDisabled = true;
|
|
2606
|
+
multilineTableComma;
|
|
2607
|
+
preferCommentForThis = false;
|
|
2608
|
+
$singlelineArray;
|
|
2609
|
+
constructor(options) {
|
|
2610
|
+
super();
|
|
2611
|
+
if (options == null) {
|
|
2612
|
+
return this;
|
|
2613
|
+
}
|
|
2614
|
+
const { integer } = options;
|
|
2615
|
+
if (integer === void 0) ;
|
|
2616
|
+
else if (integer === MAX_SAFE_INTEGER) {
|
|
2617
|
+
this.asInteger = isSafeInteger;
|
|
2618
|
+
} else if (typeof integer === "number") {
|
|
2619
|
+
if (!isSafeInteger(integer)) {
|
|
2620
|
+
throw RangeError$1(`TOML.stringify(,{integer}) can only be a safe integer`);
|
|
2621
|
+
}
|
|
2622
|
+
const max = integer >= 0 ? integer : -integer - 1;
|
|
2623
|
+
const min = integer >= 0 ? -integer : integer;
|
|
2624
|
+
this.asInteger = (number) => isSafeInteger(number) && min <= number && number <= max;
|
|
2625
|
+
} else {
|
|
2626
|
+
throw TypeError$1(`TOML.stringify(,{integer}) can only be number`);
|
|
2627
|
+
}
|
|
2628
|
+
const { newline } = options;
|
|
2629
|
+
if (newline === void 0) ;
|
|
2630
|
+
else if (newline === "\n" || newline === "\r\n") {
|
|
2631
|
+
this.newline = newline;
|
|
2632
|
+
} else {
|
|
2633
|
+
throw typeof newline === "string" ? SyntaxError$1(`TOML.stringify(,{newline}) can only be valid TOML newline`) : TypeError$1(`TOML.stringify(,{newline}) can only be string`);
|
|
2634
|
+
}
|
|
2635
|
+
const { preferCommentFor } = options;
|
|
2636
|
+
if (preferCommentFor === void 0) ;
|
|
2637
|
+
else if (preferCommentFor === "this" || preferCommentFor === "key") {
|
|
2638
|
+
this.preferCommentForThis = preferCommentFor === "this";
|
|
2639
|
+
} else {
|
|
2640
|
+
throw TypeError$1(`TOML.stringify(,{preferCommentFor) can only be 'key' or 'this'`);
|
|
2641
|
+
}
|
|
2642
|
+
const { [options.newlineAround || "header"]: around = name2code.header } = name2code;
|
|
2643
|
+
this.newlineUnderSection = around > 0;
|
|
2644
|
+
this.newlineUnderSectionButPair = around === 1 || around === 2;
|
|
2645
|
+
this.newlineUnderHeader = around > 1;
|
|
2646
|
+
this.newlineUnderPair = around > 2;
|
|
2647
|
+
this.newlineUnderPairButDotted = around === 3;
|
|
2648
|
+
this.newlineUnderDotted = around > 3;
|
|
2649
|
+
const { indent } = options;
|
|
2650
|
+
if (indent === void 0) ;
|
|
2651
|
+
else if (typeof indent === "string") {
|
|
2652
|
+
if (!IS_INDENT(indent)) {
|
|
2653
|
+
throw SyntaxError$1(`TOML.stringify(,{indent}) can only include Tab or Space`);
|
|
2654
|
+
}
|
|
2655
|
+
this.indent = indent;
|
|
2656
|
+
} else if (typeof indent === "number") {
|
|
2657
|
+
if (!isSafeInteger(indent)) {
|
|
2658
|
+
throw RangeError$1(`TOML.stringify(,{indent:${indent}}) is out of range`);
|
|
2659
|
+
}
|
|
2660
|
+
this.indent = " ".repeat(indent);
|
|
2661
|
+
} else {
|
|
2662
|
+
throw TypeError$1(`TOML.stringify(,{indent}) can not be "${typeof indent}" type`);
|
|
2663
|
+
}
|
|
2664
|
+
const { T: T2 } = options;
|
|
2665
|
+
if (T2 === void 0) ;
|
|
2666
|
+
else if (T2 === " " || T2 === "t" || T2 === "T") {
|
|
2667
|
+
this.T = T2;
|
|
2668
|
+
} else {
|
|
2669
|
+
throw TypeError$1(`TOML.stringify(,{T}) can only be "T" or " " or "t"`);
|
|
2670
|
+
}
|
|
2671
|
+
const { Z } = options;
|
|
2672
|
+
if (Z === void 0) ;
|
|
2673
|
+
else if (Z === "z" || Z === "Z") {
|
|
2674
|
+
this.Z = Z;
|
|
2675
|
+
} else {
|
|
2676
|
+
throw TypeError$1(`TOML.stringify(,{Z}) can only be "Z" or "z"`);
|
|
2677
|
+
}
|
|
2678
|
+
if (options.xNull) {
|
|
2679
|
+
this.nullDisabled = false;
|
|
2680
|
+
}
|
|
2681
|
+
const { xBeforeNewlineInMultilineTable } = options;
|
|
2682
|
+
if (xBeforeNewlineInMultilineTable === void 0) ;
|
|
2683
|
+
else if (xBeforeNewlineInMultilineTable === "" || xBeforeNewlineInMultilineTable === ",") {
|
|
2684
|
+
this.multilineTableDisabled = false;
|
|
2685
|
+
this.multilineTableComma = !!xBeforeNewlineInMultilineTable;
|
|
2686
|
+
} else {
|
|
2687
|
+
throw TypeError$1(`TOML.stringify(,{xBeforeNewlineInMultilineTable}) can only be "" or ","`);
|
|
2688
|
+
}
|
|
2689
|
+
const $singlelineArray = options.forceInlineArraySpacing;
|
|
2690
|
+
switch ($singlelineArray) {
|
|
2691
|
+
case void 0:
|
|
2692
|
+
break;
|
|
2693
|
+
case 0:
|
|
2694
|
+
case 1:
|
|
2695
|
+
case 2:
|
|
2696
|
+
case 3:
|
|
2697
|
+
this.$singlelineArray = $singlelineArray;
|
|
2698
|
+
break;
|
|
2699
|
+
default:
|
|
2700
|
+
throw typeof $singlelineArray === "number" ? RangeError$1(`array inline mode must be 0 | 1 | 2 | 3, not including ${$singlelineArray}`) : TypeError$1(`array inline mode must be "number" type, not including ${$singlelineArray === null ? '"null"' : typeof $singlelineArray}`);
|
|
2701
|
+
}
|
|
2702
|
+
return this;
|
|
2703
|
+
}
|
|
2704
|
+
appendSection() {
|
|
2705
|
+
return this[this.length] = new TOMLSection(this);
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
var linesFromStringify = new WeakSet$1();
|
|
2709
|
+
var beLinesFromStringify = /* @__PURE__ */ add.bind(linesFromStringify);
|
|
2710
|
+
var isLinesFromStringify = /* @__PURE__ */ has.bind(linesFromStringify);
|
|
2711
|
+
var stringify = (rootTable, options) => {
|
|
2712
|
+
const document = new TOMLDocument(options);
|
|
2713
|
+
const section = document[0];
|
|
2714
|
+
section[0] = "";
|
|
2715
|
+
x(section.assignBlock(``, ``, rootTable, getOwnPropertyNames(rootTable)));
|
|
2716
|
+
document.newlineUnderSectionButPair && section.length !== 1 && section.appendNewline();
|
|
2717
|
+
document.newlineUnderSection || document[document.length - 1].appendNewline();
|
|
2718
|
+
if (document.newline) {
|
|
2719
|
+
return document.join(document.newline);
|
|
2720
|
+
}
|
|
2721
|
+
const lines = document.flat();
|
|
2722
|
+
beLinesFromStringify(lines);
|
|
2723
|
+
return lines;
|
|
2724
|
+
};
|
|
2725
|
+
var multiline = /* @__PURE__ */ (() => {
|
|
2726
|
+
const multiline2 = (value, string) => typeof value === "string" ? LiteralObject((multilineNeedBasic(value) ? multilineBasicString : multilineLiteralString)(("\n" + value).split("\n")), value) : isArray$1(value) ? LiteralObject(multilineString(Lines(value)), typeof string === "string" ? string : Null$1(null)) : multilineTable(value);
|
|
2727
|
+
multiline2.basic = (lines, string) => typeof lines === "string" ? LiteralObject(multilineBasicString(("\n" + lines).split("\n")), lines) : LiteralObject(multilineBasicString(Lines(lines)), typeof string === "string" ? string : Null$1(null));
|
|
2728
|
+
multiline2.array = multilineArray;
|
|
2729
|
+
freeze(multiline2);
|
|
2730
|
+
return multiline2;
|
|
2731
|
+
})();
|
|
2732
|
+
var basic = (value) => LiteralObject(singlelineBasicString(value), value);
|
|
2733
|
+
var literal = (literal2, ...chars) => {
|
|
2734
|
+
if (typeof literal2 === "string") {
|
|
2735
|
+
if (chars.length === 1) {
|
|
2736
|
+
return LiteralObject(literal2.includes("\n") ? literal2.split("\n") : literal2, chars[0]);
|
|
2737
|
+
}
|
|
2738
|
+
} else {
|
|
2739
|
+
let index = chars.length;
|
|
2740
|
+
if (index) {
|
|
2741
|
+
const { raw } = literal2;
|
|
2742
|
+
literal2 = raw[index];
|
|
2743
|
+
while (index) {
|
|
2744
|
+
chars[--index] += raw[index];
|
|
2745
|
+
}
|
|
2746
|
+
literal2 = chars.join("") + literal2;
|
|
2747
|
+
} else {
|
|
2748
|
+
literal2 = literal2.raw[0];
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
return LiteralObject(literal2.includes("\n") ? literal2.split("\n") : literal2, Null$1(null));
|
|
2752
|
+
};
|
|
2753
|
+
var textDecoder = /* @__PURE__ */ new TextDecoder$1("utf-8", Null$1({ fatal: true, ignoreBOM: false }));
|
|
2754
|
+
var binary2string = (arrayBufferLike) => {
|
|
2755
|
+
if (isView(arrayBufferLike) ? arrayBufferLike.length !== arrayBufferLike.byteLength : !isArrayBuffer(arrayBufferLike)) {
|
|
2756
|
+
throw TypeError$1(`only Uint8Array or ArrayBuffer is acceptable`);
|
|
2757
|
+
}
|
|
2758
|
+
try {
|
|
2759
|
+
return textDecoder.decode(arrayBufferLike);
|
|
2760
|
+
} catch {
|
|
2761
|
+
throw Error$1(`A TOML doc must be a (ful-scalar) valid UTF-8 file, without any unknown code point.`);
|
|
2762
|
+
}
|
|
2763
|
+
};
|
|
2764
|
+
var isBinaryLike = (value) => "byteLength" in value;
|
|
2765
|
+
var { test: includesNonScalar } = theRegExp(/[\uD800-\uDFFF]/u);
|
|
2766
|
+
var assertFulScalar = (string) => {
|
|
2767
|
+
if (clearRegExp$1(includesNonScalar(string))) {
|
|
2768
|
+
throw Error$1(`A TOML doc must be a (ful-scalar) valid UTF-8 file, without any uncoupled UCS-4 character code.`);
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
var holding = false;
|
|
2772
|
+
var parse = (source, specificationVersion, multilineStringJoiner, bigint, x2, argsMode) => {
|
|
2773
|
+
let sourcePath2 = "";
|
|
2774
|
+
if (typeof source === "object" && source) {
|
|
2775
|
+
if (isArray$1(source)) {
|
|
2776
|
+
throw TypeError$1(isLinesFromStringify(source) ? `TOML.parse(array from TOML.stringify(,{newline?}))` : `TOML.parse(array)`);
|
|
2777
|
+
} else if (isBinaryLike(source)) {
|
|
2778
|
+
source = binary2string(source);
|
|
2779
|
+
} else {
|
|
2780
|
+
sourcePath2 = source.path;
|
|
2781
|
+
if (typeof sourcePath2 !== "string") {
|
|
2782
|
+
throw TypeError$1(`TOML.parse(source.path)`);
|
|
2783
|
+
}
|
|
2784
|
+
const { data, require: req = typeof require === "function" ? require : undefined$1 } = source;
|
|
2785
|
+
if (req) {
|
|
2786
|
+
const { resolve } = req;
|
|
2787
|
+
if (resolve != null) {
|
|
2788
|
+
const { paths } = resolve;
|
|
2789
|
+
if (paths != null) {
|
|
2790
|
+
const ret = apply$1(paths, resolve, [""]);
|
|
2791
|
+
if (ret != null) {
|
|
2792
|
+
const val = ret[0];
|
|
2793
|
+
if (val != null) {
|
|
2794
|
+
const dirname_ = val.replace(/node_modules$/, "");
|
|
2795
|
+
if (dirname_) {
|
|
2796
|
+
sourcePath2 = req("path").resolve(dirname_, sourcePath2);
|
|
2797
|
+
if (typeof sourcePath2 !== "string") {
|
|
2798
|
+
throw TypeError$1(`TOML.parse(source.require('path').resolve)`);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
if (data === undefined$1) {
|
|
2806
|
+
const data2 = req("fs").readFileSync(sourcePath2);
|
|
2807
|
+
if (typeof data2 === "object" && data2 && isBinaryLike(data2)) {
|
|
2808
|
+
source = binary2string(data2);
|
|
2809
|
+
} else {
|
|
2810
|
+
throw TypeError$1(`TOML.parse(source.require('fs').readFileSync)`);
|
|
2811
|
+
}
|
|
2812
|
+
} else if (typeof data === "string") {
|
|
2813
|
+
assertFulScalar(source = data);
|
|
2814
|
+
} else if (typeof data === "object" && data && isBinaryLike(data)) {
|
|
2815
|
+
source = binary2string(data);
|
|
2816
|
+
} else {
|
|
2817
|
+
throw TypeError$1(`TOML.parse(source.data)`);
|
|
2818
|
+
}
|
|
2819
|
+
} else {
|
|
2820
|
+
if (data === undefined$1) {
|
|
2821
|
+
throw TypeError$1(`TOML.parse(source.data|source.require)`);
|
|
2822
|
+
} else if (typeof data === "string") {
|
|
2823
|
+
assertFulScalar(source = data);
|
|
2824
|
+
} else if (typeof data === "object" && data && isBinaryLike(data)) {
|
|
2825
|
+
source = binary2string(data);
|
|
2826
|
+
} else {
|
|
2827
|
+
throw TypeError$1(`TOML.parse(source.data)`);
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
} else if (typeof source === "string") {
|
|
2832
|
+
assertFulScalar(source);
|
|
2833
|
+
} else {
|
|
2834
|
+
throw TypeError$1(`TOML.parse(source)`);
|
|
2835
|
+
}
|
|
2836
|
+
let joiner;
|
|
2837
|
+
let keys2;
|
|
2838
|
+
if (typeof multilineStringJoiner === "object" && multilineStringJoiner) {
|
|
2839
|
+
if (bigint !== undefined$1 || x2 !== undefined$1) {
|
|
2840
|
+
throw TypeError$1(`options mode ? args mode`);
|
|
2841
|
+
}
|
|
2842
|
+
joiner = multilineStringJoiner.joiner;
|
|
2843
|
+
bigint = multilineStringJoiner.bigint;
|
|
2844
|
+
keys2 = multilineStringJoiner.keys;
|
|
2845
|
+
x2 = multilineStringJoiner.x;
|
|
2846
|
+
argsMode = "";
|
|
2847
|
+
} else {
|
|
2848
|
+
joiner = multilineStringJoiner;
|
|
2849
|
+
}
|
|
2850
|
+
let rootTable;
|
|
2851
|
+
let process;
|
|
2852
|
+
if (holding) {
|
|
2853
|
+
throw Error$1(`parsing during parsing.`);
|
|
2854
|
+
}
|
|
2855
|
+
holding = true;
|
|
2856
|
+
try {
|
|
2857
|
+
use(specificationVersion, joiner, bigint, keys2, x2, argsMode);
|
|
2858
|
+
todo(source, sourcePath2);
|
|
2859
|
+
source && source[0] === "\uFEFF" && throws(TypeError$1(`TOML content (string) should not start with BOM (U+FEFF)` + where(" at ")));
|
|
2860
|
+
rootTable = Root();
|
|
2861
|
+
process = Process();
|
|
2862
|
+
} finally {
|
|
2863
|
+
done();
|
|
2864
|
+
clear();
|
|
2865
|
+
holding = false;
|
|
2866
|
+
clearRegExp$1();
|
|
2867
|
+
}
|
|
2868
|
+
process && process();
|
|
2869
|
+
return rootTable;
|
|
2870
|
+
};
|
|
2871
|
+
var parse$1 = /* @__PURE__ */ assign$1(
|
|
2872
|
+
(source, specificationVersion, multilineStringJoiner, useBigInt, xOptions) => typeof specificationVersion === "number" ? parse(source, specificationVersion, multilineStringJoiner, useBigInt, xOptions, ",,") : parse(source, 1, specificationVersion, multilineStringJoiner, useBigInt, ","),
|
|
2873
|
+
{
|
|
2874
|
+
"1.0": (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.1, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2875
|
+
1: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 1, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2876
|
+
0.5: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.5, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2877
|
+
0.4: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.4, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2878
|
+
0.3: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.3, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2879
|
+
0.2: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.2, multilineStringJoiner, useBigInt, xOptions, ","),
|
|
2880
|
+
0.1: (source, multilineStringJoiner, useBigInt, xOptions) => parse(source, 0.1, multilineStringJoiner, useBigInt, xOptions, ",")
|
|
2881
|
+
}
|
|
2882
|
+
);
|
|
2883
|
+
var _export = /* @__PURE__ */ Default({
|
|
2884
|
+
version,
|
|
2885
|
+
parse: parse$1,
|
|
2886
|
+
stringify,
|
|
2887
|
+
Section,
|
|
2888
|
+
inline,
|
|
2889
|
+
multiline,
|
|
2890
|
+
basic,
|
|
2891
|
+
literal,
|
|
2892
|
+
commentFor,
|
|
2893
|
+
commentForThis,
|
|
2894
|
+
OffsetDateTime,
|
|
2895
|
+
LocalDateTime,
|
|
2896
|
+
LocalDate,
|
|
2897
|
+
LocalTime,
|
|
2898
|
+
isInline,
|
|
2899
|
+
isSection,
|
|
2900
|
+
Keys
|
|
2901
|
+
});
|
|
2902
|
+
|
|
2903
|
+
// packages/workspace-tools/src/utils/toml.ts
|
|
2904
|
+
var import_devkit = require("@nx/devkit");
|
|
2905
|
+
function parseCargoTomlWithTree(tree, projectRoot, projectName) {
|
|
2906
|
+
const cargoTomlString = tree.read(`${projectRoot}/Cargo.toml`)?.toString();
|
|
2907
|
+
if (!cargoTomlString) {
|
|
2908
|
+
import_devkit.logger.error(`Cannot find a Cargo.toml file in the ${projectName}`);
|
|
2909
|
+
throw new Error();
|
|
2910
|
+
}
|
|
2911
|
+
return parseCargoToml(cargoTomlString);
|
|
2912
|
+
}
|
|
2913
|
+
function parseCargoToml(cargoString) {
|
|
2914
|
+
if (!cargoString) {
|
|
2915
|
+
throw new Error("Cargo.toml is empty");
|
|
2916
|
+
}
|
|
2917
|
+
return _export.parse(cargoString, {
|
|
2918
|
+
x: { comment: true }
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
function stringifyCargoToml(cargoToml) {
|
|
2922
|
+
const tomlString = _export.stringify(cargoToml, {
|
|
2923
|
+
newlineAround: "section"
|
|
2924
|
+
});
|
|
2925
|
+
if (Array.isArray(tomlString)) {
|
|
2926
|
+
return tomlString.join("\n");
|
|
2927
|
+
}
|
|
2928
|
+
return tomlString;
|
|
2929
|
+
}
|
|
2930
|
+
function modifyCargoTable(toml, section, key, value) {
|
|
2931
|
+
toml[section] ??= _export.Section({});
|
|
2932
|
+
toml[section][key] = typeof value === "object" && !Array.isArray(value) ? _export.inline(value) : typeof value === "function" ? value() : value;
|
|
2933
|
+
}
|
|
2934
|
+
function modifyCargoNestedTable(toml, section, key, value) {
|
|
2935
|
+
toml[section] ??= {};
|
|
2936
|
+
toml[section][key] = _export.Section(value);
|
|
2937
|
+
}
|
|
2938
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2939
|
+
0 && (module.exports = {
|
|
2940
|
+
modifyCargoNestedTable,
|
|
2941
|
+
modifyCargoTable,
|
|
2942
|
+
parseCargoToml,
|
|
2943
|
+
parseCargoTomlWithTree,
|
|
2944
|
+
stringifyCargoToml
|
|
2945
|
+
});
|
|
2946
|
+
/*! Bundled license information:
|
|
2947
|
+
|
|
2948
|
+
@ltd/j-toml/index.mjs:
|
|
2949
|
+
(*!@preserve@license
|
|
2950
|
+
* 模块名称:j-regexp
|
|
2951
|
+
* 模块功能:可读性更好的正则表达式创建方式。从属于“简计划”。
|
|
2952
|
+
More readable way for creating RegExp. Belong to "Plan J".
|
|
2953
|
+
* 模块版本:8.2.0
|
|
2954
|
+
* 许可条款:LGPL-3.0
|
|
2955
|
+
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
|
|
2956
|
+
* 问题反馈:https://GitHub.com/LongTengDao/j-regexp/issues
|
|
2957
|
+
* 项目主页:https://GitHub.com/LongTengDao/j-regexp/
|
|
2958
|
+
*)
|
|
2959
|
+
(*!@preserve@license
|
|
2960
|
+
* 模块名称:j-orderify
|
|
2961
|
+
* 模块功能:返回一个能保证给定对象的属性按此后添加顺序排列的 proxy,即使键名是 symbol,或整数 string。从属于“简计划”。
|
|
2962
|
+
Return a proxy for given object, which can guarantee own keys are in setting order, even if the key name is symbol or int string. Belong to "Plan J".
|
|
2963
|
+
* 模块版本:7.0.1
|
|
2964
|
+
* 许可条款:LGPL-3.0
|
|
2965
|
+
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
|
|
2966
|
+
* 问题反馈:https://GitHub.com/LongTengDao/j-orderify/issues
|
|
2967
|
+
* 项目主页:https://GitHub.com/LongTengDao/j-orderify/
|
|
2968
|
+
*)
|
|
2969
|
+
*/
|