@cloudflare/workers-utils 0.0.2 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2126 +1,13 @@
1
+ import { __name, UserError, PATH_TO_DEPLOY_CONFIG, FatalError } from './chunk-PSOC3TD3.mjs';
2
+ export { CommandLineArgsError, DeprecationError, ENVIRONMENT_TAG_PREFIX, FatalError, INHERIT_SYMBOL, JsonFriendlyFatalError, MissingConfigError, PATH_TO_DEPLOY_CONFIG, SERVICE_TAG_PREFIX, UserError, assertNever, constructWranglerConfig, createFatalError, formatCompatibilityDate, mapWorkerMetadataBindings } from './chunk-PSOC3TD3.mjs';
1
3
  import fs, { readFileSync as readFileSync$1, existsSync } from 'node:fs';
2
4
  import path5, { resolve } from 'node:path';
3
5
  import { fileURLToPath } from 'node:url';
4
6
  import process2 from 'node:process';
5
- import { writeFileSync, statSync, existsSync as existsSync$1 } from 'fs';
7
+ import { statSync, existsSync as existsSync$1, writeFileSync } from 'fs';
6
8
  import assert from 'node:assert';
7
9
  import path4 from 'path';
8
10
 
9
- var __create = Object.create;
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __getProtoOf = Object.getPrototypeOf;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
16
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
17
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
18
- }) : x)(function(x) {
19
- if (typeof require !== "undefined") return require.apply(this, arguments);
20
- throw Error('Dynamic require of "' + x + '" is not supported');
21
- });
22
- var __commonJS = (cb, mod) => function __require2() {
23
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
- };
25
- var __copyProps = (to, from, except, desc) => {
26
- if (from && typeof from === "object" || typeof from === "function") {
27
- for (let key of __getOwnPropNames(from))
28
- if (!__hasOwnProp.call(to, key) && key !== except)
29
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30
- }
31
- return to;
32
- };
33
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
34
- // If the importer is in node compatibility mode or this is not an ESM
35
- // file that has been converted to a CommonJS file using a Babel-
36
- // compatible transform (i.e. "__esModule" has not been set), then set
37
- // "default" to the CommonJS "module.exports" for node compatibility.
38
- !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39
- mod
40
- ));
41
-
42
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js
43
- var require_parser = __commonJS({
44
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js"(exports2, module2) {
45
- var ParserEND = 1114112;
46
- var ParserError = class _ParserError extends Error {
47
- static {
48
- __name(this, "ParserError");
49
- }
50
- /* istanbul ignore next */
51
- constructor(msg, filename, linenumber) {
52
- super("[ParserError] " + msg, filename, linenumber);
53
- this.name = "ParserError";
54
- this.code = "ParserError";
55
- if (Error.captureStackTrace) Error.captureStackTrace(this, _ParserError);
56
- }
57
- };
58
- var State = class {
59
- static {
60
- __name(this, "State");
61
- }
62
- constructor(parser) {
63
- this.parser = parser;
64
- this.buf = "";
65
- this.returned = null;
66
- this.result = null;
67
- this.resultTable = null;
68
- this.resultArr = null;
69
- }
70
- };
71
- var Parser = class {
72
- static {
73
- __name(this, "Parser");
74
- }
75
- constructor() {
76
- this.pos = 0;
77
- this.col = 0;
78
- this.line = 0;
79
- this.obj = {};
80
- this.ctx = this.obj;
81
- this.stack = [];
82
- this._buf = "";
83
- this.char = null;
84
- this.ii = 0;
85
- this.state = new State(this.parseStart);
86
- }
87
- parse(str) {
88
- if (str.length === 0 || str.length == null) return;
89
- this._buf = String(str);
90
- this.ii = -1;
91
- this.char = -1;
92
- let getNext;
93
- while (getNext === false || this.nextChar()) {
94
- getNext = this.runOne();
95
- }
96
- this._buf = null;
97
- }
98
- nextChar() {
99
- if (this.char === 10) {
100
- ++this.line;
101
- this.col = -1;
102
- }
103
- ++this.ii;
104
- this.char = this._buf.codePointAt(this.ii);
105
- ++this.pos;
106
- ++this.col;
107
- return this.haveBuffer();
108
- }
109
- haveBuffer() {
110
- return this.ii < this._buf.length;
111
- }
112
- runOne() {
113
- return this.state.parser.call(this, this.state.returned);
114
- }
115
- finish() {
116
- this.char = ParserEND;
117
- let last;
118
- do {
119
- last = this.state.parser;
120
- this.runOne();
121
- } while (this.state.parser !== last);
122
- this.ctx = null;
123
- this.state = null;
124
- this._buf = null;
125
- return this.obj;
126
- }
127
- next(fn) {
128
- if (typeof fn !== "function") throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
129
- this.state.parser = fn;
130
- }
131
- goto(fn) {
132
- this.next(fn);
133
- return this.runOne();
134
- }
135
- call(fn, returnWith) {
136
- if (returnWith) this.next(returnWith);
137
- this.stack.push(this.state);
138
- this.state = new State(fn);
139
- }
140
- callNow(fn, returnWith) {
141
- this.call(fn, returnWith);
142
- return this.runOne();
143
- }
144
- return(value) {
145
- if (this.stack.length === 0) throw this.error(new ParserError("Stack underflow"));
146
- if (value === void 0) value = this.state.buf;
147
- this.state = this.stack.pop();
148
- this.state.returned = value;
149
- }
150
- returnNow(value) {
151
- this.return(value);
152
- return this.runOne();
153
- }
154
- consume() {
155
- if (this.char === ParserEND) throw this.error(new ParserError("Unexpected end-of-buffer"));
156
- this.state.buf += this._buf[this.ii];
157
- }
158
- error(err) {
159
- err.line = this.line;
160
- err.col = this.col;
161
- err.pos = this.pos;
162
- return err;
163
- }
164
- /* istanbul ignore next */
165
- parseStart() {
166
- throw new ParserError("Must declare a parseStart method");
167
- }
168
- };
169
- Parser.END = ParserEND;
170
- Parser.Error = ParserError;
171
- module2.exports = Parser;
172
- }
173
- });
174
-
175
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js
176
- var require_create_datetime = __commonJS({
177
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js"(exports2, module2) {
178
- module2.exports = (value) => {
179
- const date = new Date(value);
180
- if (isNaN(date)) {
181
- throw new TypeError("Invalid Datetime");
182
- } else {
183
- return date;
184
- }
185
- };
186
- }
187
- });
188
-
189
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js
190
- var require_format_num = __commonJS({
191
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js"(exports2, module2) {
192
- module2.exports = (d, num) => {
193
- num = String(num);
194
- while (num.length < d) num = "0" + num;
195
- return num;
196
- };
197
- }
198
- });
199
-
200
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js
201
- var require_create_datetime_float = __commonJS({
202
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js"(exports2, module2) {
203
- var f = require_format_num();
204
- var FloatingDateTime = class extends Date {
205
- static {
206
- __name(this, "FloatingDateTime");
207
- }
208
- constructor(value) {
209
- super(value + "Z");
210
- this.isFloating = true;
211
- }
212
- toISOString() {
213
- const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
214
- const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
215
- return `${date}T${time}`;
216
- }
217
- };
218
- module2.exports = (value) => {
219
- const date = new FloatingDateTime(value);
220
- if (isNaN(date)) {
221
- throw new TypeError("Invalid Datetime");
222
- } else {
223
- return date;
224
- }
225
- };
226
- }
227
- });
228
-
229
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js
230
- var require_create_date = __commonJS({
231
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js"(exports2, module2) {
232
- var f = require_format_num();
233
- var DateTime = global.Date;
234
- var Date2 = class extends DateTime {
235
- static {
236
- __name(this, "Date");
237
- }
238
- constructor(value) {
239
- super(value);
240
- this.isDate = true;
241
- }
242
- toISOString() {
243
- return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
244
- }
245
- };
246
- module2.exports = (value) => {
247
- const date = new Date2(value);
248
- if (isNaN(date)) {
249
- throw new TypeError("Invalid Datetime");
250
- } else {
251
- return date;
252
- }
253
- };
254
- }
255
- });
256
-
257
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js
258
- var require_create_time = __commonJS({
259
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js"(exports2, module2) {
260
- var f = require_format_num();
261
- var Time = class extends Date {
262
- static {
263
- __name(this, "Time");
264
- }
265
- constructor(value) {
266
- super(`0000-01-01T${value}Z`);
267
- this.isTime = true;
268
- }
269
- toISOString() {
270
- return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
271
- }
272
- };
273
- module2.exports = (value) => {
274
- const date = new Time(value);
275
- if (isNaN(date)) {
276
- throw new TypeError("Invalid Datetime");
277
- } else {
278
- return date;
279
- }
280
- };
281
- }
282
- });
283
-
284
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js
285
- var require_toml_parser = __commonJS({
286
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js"(exports, module) {
287
- module.exports = makeParserClass(require_parser());
288
- module.exports.makeParserClass = makeParserClass;
289
- var TomlError = class _TomlError extends Error {
290
- static {
291
- __name(this, "TomlError");
292
- }
293
- constructor(msg) {
294
- super(msg);
295
- this.name = "TomlError";
296
- if (Error.captureStackTrace) Error.captureStackTrace(this, _TomlError);
297
- this.fromTOML = true;
298
- this.wrapped = null;
299
- }
300
- };
301
- TomlError.wrap = (err) => {
302
- const terr = new TomlError(err.message);
303
- terr.code = err.code;
304
- terr.wrapped = err;
305
- return terr;
306
- };
307
- module.exports.TomlError = TomlError;
308
- var createDateTime = require_create_datetime();
309
- var createDateTimeFloat = require_create_datetime_float();
310
- var createDate = require_create_date();
311
- var createTime = require_create_time();
312
- var CTRL_I = 9;
313
- var CTRL_J = 10;
314
- var CTRL_M = 13;
315
- var CTRL_CHAR_BOUNDARY = 31;
316
- var CHAR_SP = 32;
317
- var CHAR_QUOT = 34;
318
- var CHAR_NUM = 35;
319
- var CHAR_APOS = 39;
320
- var CHAR_PLUS = 43;
321
- var CHAR_COMMA = 44;
322
- var CHAR_HYPHEN = 45;
323
- var CHAR_PERIOD = 46;
324
- var CHAR_0 = 48;
325
- var CHAR_1 = 49;
326
- var CHAR_7 = 55;
327
- var CHAR_9 = 57;
328
- var CHAR_COLON = 58;
329
- var CHAR_EQUALS = 61;
330
- var CHAR_A = 65;
331
- var CHAR_E = 69;
332
- var CHAR_F = 70;
333
- var CHAR_T = 84;
334
- var CHAR_U = 85;
335
- var CHAR_Z = 90;
336
- var CHAR_LOWBAR = 95;
337
- var CHAR_a = 97;
338
- var CHAR_b = 98;
339
- var CHAR_e = 101;
340
- var CHAR_f = 102;
341
- var CHAR_i = 105;
342
- var CHAR_l = 108;
343
- var CHAR_n = 110;
344
- var CHAR_o = 111;
345
- var CHAR_r = 114;
346
- var CHAR_s = 115;
347
- var CHAR_t = 116;
348
- var CHAR_u = 117;
349
- var CHAR_x = 120;
350
- var CHAR_z = 122;
351
- var CHAR_LCUB = 123;
352
- var CHAR_RCUB = 125;
353
- var CHAR_LSQB = 91;
354
- var CHAR_BSOL = 92;
355
- var CHAR_RSQB = 93;
356
- var CHAR_DEL = 127;
357
- var SURROGATE_FIRST = 55296;
358
- var SURROGATE_LAST = 57343;
359
- var escapes = {
360
- [CHAR_b]: "\b",
361
- [CHAR_t]: " ",
362
- [CHAR_n]: "\n",
363
- [CHAR_f]: "\f",
364
- [CHAR_r]: "\r",
365
- [CHAR_QUOT]: '"',
366
- [CHAR_BSOL]: "\\"
367
- };
368
- function isDigit(cp) {
369
- return cp >= CHAR_0 && cp <= CHAR_9;
370
- }
371
- __name(isDigit, "isDigit");
372
- function isHexit(cp) {
373
- return cp >= CHAR_A && cp <= CHAR_F || cp >= CHAR_a && cp <= CHAR_f || cp >= CHAR_0 && cp <= CHAR_9;
374
- }
375
- __name(isHexit, "isHexit");
376
- function isBit(cp) {
377
- return cp === CHAR_1 || cp === CHAR_0;
378
- }
379
- __name(isBit, "isBit");
380
- function isOctit(cp) {
381
- return cp >= CHAR_0 && cp <= CHAR_7;
382
- }
383
- __name(isOctit, "isOctit");
384
- function isAlphaNumQuoteHyphen(cp) {
385
- return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_APOS || cp === CHAR_QUOT || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
386
- }
387
- __name(isAlphaNumQuoteHyphen, "isAlphaNumQuoteHyphen");
388
- function isAlphaNumHyphen(cp) {
389
- return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
390
- }
391
- __name(isAlphaNumHyphen, "isAlphaNumHyphen");
392
- var _type = Symbol("type");
393
- var _declared = Symbol("declared");
394
- var hasOwnProperty = Object.prototype.hasOwnProperty;
395
- var defineProperty = Object.defineProperty;
396
- var descriptor = { configurable: true, enumerable: true, writable: true, value: void 0 };
397
- function hasKey(obj, key) {
398
- if (hasOwnProperty.call(obj, key)) return true;
399
- if (key === "__proto__") defineProperty(obj, "__proto__", descriptor);
400
- return false;
401
- }
402
- __name(hasKey, "hasKey");
403
- var INLINE_TABLE = Symbol("inline-table");
404
- function InlineTable() {
405
- return Object.defineProperties({}, {
406
- [_type]: { value: INLINE_TABLE }
407
- });
408
- }
409
- __name(InlineTable, "InlineTable");
410
- function isInlineTable(obj) {
411
- if (obj === null || typeof obj !== "object") return false;
412
- return obj[_type] === INLINE_TABLE;
413
- }
414
- __name(isInlineTable, "isInlineTable");
415
- var TABLE = Symbol("table");
416
- function Table() {
417
- return Object.defineProperties({}, {
418
- [_type]: { value: TABLE },
419
- [_declared]: { value: false, writable: true }
420
- });
421
- }
422
- __name(Table, "Table");
423
- function isTable(obj) {
424
- if (obj === null || typeof obj !== "object") return false;
425
- return obj[_type] === TABLE;
426
- }
427
- __name(isTable, "isTable");
428
- var _contentType = Symbol("content-type");
429
- var INLINE_LIST = Symbol("inline-list");
430
- function InlineList(type) {
431
- return Object.defineProperties([], {
432
- [_type]: { value: INLINE_LIST },
433
- [_contentType]: { value: type }
434
- });
435
- }
436
- __name(InlineList, "InlineList");
437
- function isInlineList(obj) {
438
- if (obj === null || typeof obj !== "object") return false;
439
- return obj[_type] === INLINE_LIST;
440
- }
441
- __name(isInlineList, "isInlineList");
442
- var LIST = Symbol("list");
443
- function List() {
444
- return Object.defineProperties([], {
445
- [_type]: { value: LIST }
446
- });
447
- }
448
- __name(List, "List");
449
- function isList(obj) {
450
- if (obj === null || typeof obj !== "object") return false;
451
- return obj[_type] === LIST;
452
- }
453
- __name(isList, "isList");
454
- var _custom;
455
- try {
456
- const utilInspect = eval("require('util').inspect");
457
- _custom = utilInspect.custom;
458
- } catch (_) {
459
- }
460
- var _inspect = _custom || "inspect";
461
- var BoxedBigInt = class {
462
- static {
463
- __name(this, "BoxedBigInt");
464
- }
465
- constructor(value) {
466
- try {
467
- this.value = global.BigInt.asIntN(64, value);
468
- } catch (_) {
469
- this.value = null;
470
- }
471
- Object.defineProperty(this, _type, { value: INTEGER });
472
- }
473
- isNaN() {
474
- return this.value === null;
475
- }
476
- /* istanbul ignore next */
477
- toString() {
478
- return String(this.value);
479
- }
480
- /* istanbul ignore next */
481
- [_inspect]() {
482
- return `[BigInt: ${this.toString()}]}`;
483
- }
484
- valueOf() {
485
- return this.value;
486
- }
487
- };
488
- var INTEGER = Symbol("integer");
489
- function Integer(value) {
490
- let num = Number(value);
491
- if (Object.is(num, -0)) num = 0;
492
- if (global.BigInt && !Number.isSafeInteger(num)) {
493
- return new BoxedBigInt(value);
494
- } else {
495
- return Object.defineProperties(new Number(num), {
496
- isNaN: { value: /* @__PURE__ */ __name(function() {
497
- return isNaN(this);
498
- }, "value") },
499
- [_type]: { value: INTEGER },
500
- [_inspect]: { value: /* @__PURE__ */ __name(() => `[Integer: ${value}]`, "value") }
501
- });
502
- }
503
- }
504
- __name(Integer, "Integer");
505
- function isInteger(obj) {
506
- if (obj === null || typeof obj !== "object") return false;
507
- return obj[_type] === INTEGER;
508
- }
509
- __name(isInteger, "isInteger");
510
- var FLOAT = Symbol("float");
511
- function Float(value) {
512
- return Object.defineProperties(new Number(value), {
513
- [_type]: { value: FLOAT },
514
- [_inspect]: { value: /* @__PURE__ */ __name(() => `[Float: ${value}]`, "value") }
515
- });
516
- }
517
- __name(Float, "Float");
518
- function isFloat(obj) {
519
- if (obj === null || typeof obj !== "object") return false;
520
- return obj[_type] === FLOAT;
521
- }
522
- __name(isFloat, "isFloat");
523
- function tomlType(value) {
524
- const type = typeof value;
525
- if (type === "object") {
526
- if (value === null) return "null";
527
- if (value instanceof Date) return "datetime";
528
- if (_type in value) {
529
- switch (value[_type]) {
530
- case INLINE_TABLE:
531
- return "inline-table";
532
- case INLINE_LIST:
533
- return "inline-list";
534
- /* istanbul ignore next */
535
- case TABLE:
536
- return "table";
537
- /* istanbul ignore next */
538
- case LIST:
539
- return "list";
540
- case FLOAT:
541
- return "float";
542
- case INTEGER:
543
- return "integer";
544
- }
545
- }
546
- }
547
- return type;
548
- }
549
- __name(tomlType, "tomlType");
550
- function makeParserClass(Parser) {
551
- class TOMLParser extends Parser {
552
- static {
553
- __name(this, "TOMLParser");
554
- }
555
- constructor() {
556
- super();
557
- this.ctx = this.obj = Table();
558
- }
559
- /* MATCH HELPER */
560
- atEndOfWord() {
561
- return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine();
562
- }
563
- atEndOfLine() {
564
- return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M;
565
- }
566
- parseStart() {
567
- if (this.char === Parser.END) {
568
- return null;
569
- } else if (this.char === CHAR_LSQB) {
570
- return this.call(this.parseTableOrList);
571
- } else if (this.char === CHAR_NUM) {
572
- return this.call(this.parseComment);
573
- } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
574
- return null;
575
- } else if (isAlphaNumQuoteHyphen(this.char)) {
576
- return this.callNow(this.parseAssignStatement);
577
- } else {
578
- throw this.error(new TomlError(`Unknown character "${this.char}"`));
579
- }
580
- }
581
- // HELPER, this strips any whitespace and comments to the end of the line
582
- // then RETURNS. Last state in a production.
583
- parseWhitespaceToEOL() {
584
- if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
585
- return null;
586
- } else if (this.char === CHAR_NUM) {
587
- return this.goto(this.parseComment);
588
- } else if (this.char === Parser.END || this.char === CTRL_J) {
589
- return this.return();
590
- } else {
591
- throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));
592
- }
593
- }
594
- /* ASSIGNMENT: key = value */
595
- parseAssignStatement() {
596
- return this.callNow(this.parseAssign, this.recordAssignStatement);
597
- }
598
- recordAssignStatement(kv) {
599
- let target = this.ctx;
600
- let finalKey = kv.key.pop();
601
- for (let kw of kv.key) {
602
- if (hasKey(target, kw) && !isTable(target[kw])) {
603
- throw this.error(new TomlError("Can't redefine existing key"));
604
- }
605
- target = target[kw] = target[kw] || Table();
606
- }
607
- if (hasKey(target, finalKey)) {
608
- throw this.error(new TomlError("Can't redefine existing key"));
609
- }
610
- target[_declared] = true;
611
- if (isInteger(kv.value) || isFloat(kv.value)) {
612
- target[finalKey] = kv.value.valueOf();
613
- } else {
614
- target[finalKey] = kv.value;
615
- }
616
- return this.goto(this.parseWhitespaceToEOL);
617
- }
618
- /* ASSSIGNMENT expression, key = value possibly inside an inline table */
619
- parseAssign() {
620
- return this.callNow(this.parseKeyword, this.recordAssignKeyword);
621
- }
622
- recordAssignKeyword(key) {
623
- if (this.state.resultTable) {
624
- this.state.resultTable.push(key);
625
- } else {
626
- this.state.resultTable = [key];
627
- }
628
- return this.goto(this.parseAssignKeywordPreDot);
629
- }
630
- parseAssignKeywordPreDot() {
631
- if (this.char === CHAR_PERIOD) {
632
- return this.next(this.parseAssignKeywordPostDot);
633
- } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {
634
- return this.goto(this.parseAssignEqual);
635
- }
636
- }
637
- parseAssignKeywordPostDot() {
638
- if (this.char !== CHAR_SP && this.char !== CTRL_I) {
639
- return this.callNow(this.parseKeyword, this.recordAssignKeyword);
640
- }
641
- }
642
- parseAssignEqual() {
643
- if (this.char === CHAR_EQUALS) {
644
- return this.next(this.parseAssignPreValue);
645
- } else {
646
- throw this.error(new TomlError('Invalid character, expected "="'));
647
- }
648
- }
649
- parseAssignPreValue() {
650
- if (this.char === CHAR_SP || this.char === CTRL_I) {
651
- return null;
652
- } else {
653
- return this.callNow(this.parseValue, this.recordAssignValue);
654
- }
655
- }
656
- recordAssignValue(value) {
657
- return this.returnNow({ key: this.state.resultTable, value });
658
- }
659
- /* COMMENTS: #...eol */
660
- parseComment() {
661
- do {
662
- if (this.char === Parser.END || this.char === CTRL_J) {
663
- return this.return();
664
- } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
665
- throw this.errorControlCharIn("comments");
666
- }
667
- } while (this.nextChar());
668
- }
669
- /* TABLES AND LISTS, [foo] and [[foo]] */
670
- parseTableOrList() {
671
- if (this.char === CHAR_LSQB) {
672
- this.next(this.parseList);
673
- } else {
674
- return this.goto(this.parseTable);
675
- }
676
- }
677
- /* TABLE [foo.bar.baz] */
678
- parseTable() {
679
- this.ctx = this.obj;
680
- return this.goto(this.parseTableNext);
681
- }
682
- parseTableNext() {
683
- if (this.char === CHAR_SP || this.char === CTRL_I) {
684
- return null;
685
- } else {
686
- return this.callNow(this.parseKeyword, this.parseTableMore);
687
- }
688
- }
689
- parseTableMore(keyword) {
690
- if (this.char === CHAR_SP || this.char === CTRL_I) {
691
- return null;
692
- } else if (this.char === CHAR_RSQB) {
693
- if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
694
- throw this.error(new TomlError("Can't redefine existing key"));
695
- } else {
696
- this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
697
- this.ctx[_declared] = true;
698
- }
699
- return this.next(this.parseWhitespaceToEOL);
700
- } else if (this.char === CHAR_PERIOD) {
701
- if (!hasKey(this.ctx, keyword)) {
702
- this.ctx = this.ctx[keyword] = Table();
703
- } else if (isTable(this.ctx[keyword])) {
704
- this.ctx = this.ctx[keyword];
705
- } else if (isList(this.ctx[keyword])) {
706
- this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
707
- } else {
708
- throw this.error(new TomlError("Can't redefine existing key"));
709
- }
710
- return this.next(this.parseTableNext);
711
- } else {
712
- throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
713
- }
714
- }
715
- /* LIST [[a.b.c]] */
716
- parseList() {
717
- this.ctx = this.obj;
718
- return this.goto(this.parseListNext);
719
- }
720
- parseListNext() {
721
- if (this.char === CHAR_SP || this.char === CTRL_I) {
722
- return null;
723
- } else {
724
- return this.callNow(this.parseKeyword, this.parseListMore);
725
- }
726
- }
727
- parseListMore(keyword) {
728
- if (this.char === CHAR_SP || this.char === CTRL_I) {
729
- return null;
730
- } else if (this.char === CHAR_RSQB) {
731
- if (!hasKey(this.ctx, keyword)) {
732
- this.ctx[keyword] = List();
733
- }
734
- if (isInlineList(this.ctx[keyword])) {
735
- throw this.error(new TomlError("Can't extend an inline array"));
736
- } else if (isList(this.ctx[keyword])) {
737
- const next = Table();
738
- this.ctx[keyword].push(next);
739
- this.ctx = next;
740
- } else {
741
- throw this.error(new TomlError("Can't redefine an existing key"));
742
- }
743
- return this.next(this.parseListEnd);
744
- } else if (this.char === CHAR_PERIOD) {
745
- if (!hasKey(this.ctx, keyword)) {
746
- this.ctx = this.ctx[keyword] = Table();
747
- } else if (isInlineList(this.ctx[keyword])) {
748
- throw this.error(new TomlError("Can't extend an inline array"));
749
- } else if (isInlineTable(this.ctx[keyword])) {
750
- throw this.error(new TomlError("Can't extend an inline table"));
751
- } else if (isList(this.ctx[keyword])) {
752
- this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
753
- } else if (isTable(this.ctx[keyword])) {
754
- this.ctx = this.ctx[keyword];
755
- } else {
756
- throw this.error(new TomlError("Can't redefine an existing key"));
757
- }
758
- return this.next(this.parseListNext);
759
- } else {
760
- throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
761
- }
762
- }
763
- parseListEnd(keyword) {
764
- if (this.char === CHAR_RSQB) {
765
- return this.next(this.parseWhitespaceToEOL);
766
- } else {
767
- throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
768
- }
769
- }
770
- /* VALUE string, number, boolean, inline list, inline object */
771
- parseValue() {
772
- if (this.char === Parser.END) {
773
- throw this.error(new TomlError("Key without value"));
774
- } else if (this.char === CHAR_QUOT) {
775
- return this.next(this.parseDoubleString);
776
- }
777
- if (this.char === CHAR_APOS) {
778
- return this.next(this.parseSingleString);
779
- } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
780
- return this.goto(this.parseNumberSign);
781
- } else if (this.char === CHAR_i) {
782
- return this.next(this.parseInf);
783
- } else if (this.char === CHAR_n) {
784
- return this.next(this.parseNan);
785
- } else if (isDigit(this.char)) {
786
- return this.goto(this.parseNumberOrDateTime);
787
- } else if (this.char === CHAR_t || this.char === CHAR_f) {
788
- return this.goto(this.parseBoolean);
789
- } else if (this.char === CHAR_LSQB) {
790
- return this.call(this.parseInlineList, this.recordValue);
791
- } else if (this.char === CHAR_LCUB) {
792
- return this.call(this.parseInlineTable, this.recordValue);
793
- } else {
794
- throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"));
795
- }
796
- }
797
- recordValue(value) {
798
- return this.returnNow(value);
799
- }
800
- parseInf() {
801
- if (this.char === CHAR_n) {
802
- return this.next(this.parseInf2);
803
- } else {
804
- throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
805
- }
806
- }
807
- parseInf2() {
808
- if (this.char === CHAR_f) {
809
- if (this.state.buf === "-") {
810
- return this.return(-Infinity);
811
- } else {
812
- return this.return(Infinity);
813
- }
814
- } else {
815
- throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
816
- }
817
- }
818
- parseNan() {
819
- if (this.char === CHAR_a) {
820
- return this.next(this.parseNan2);
821
- } else {
822
- throw this.error(new TomlError('Unexpected character, expected "nan"'));
823
- }
824
- }
825
- parseNan2() {
826
- if (this.char === CHAR_n) {
827
- return this.return(NaN);
828
- } else {
829
- throw this.error(new TomlError('Unexpected character, expected "nan"'));
830
- }
831
- }
832
- /* KEYS, barewords or basic, literal, or dotted */
833
- parseKeyword() {
834
- if (this.char === CHAR_QUOT) {
835
- return this.next(this.parseBasicString);
836
- } else if (this.char === CHAR_APOS) {
837
- return this.next(this.parseLiteralString);
838
- } else {
839
- return this.goto(this.parseBareKey);
840
- }
841
- }
842
- /* KEYS: barewords */
843
- parseBareKey() {
844
- do {
845
- if (this.char === Parser.END) {
846
- throw this.error(new TomlError("Key ended without value"));
847
- } else if (isAlphaNumHyphen(this.char)) {
848
- this.consume();
849
- } else if (this.state.buf.length === 0) {
850
- throw this.error(new TomlError("Empty bare keys are not allowed"));
851
- } else {
852
- return this.returnNow();
853
- }
854
- } while (this.nextChar());
855
- }
856
- /* STRINGS, single quoted (literal) */
857
- parseSingleString() {
858
- if (this.char === CHAR_APOS) {
859
- return this.next(this.parseLiteralMultiStringMaybe);
860
- } else {
861
- return this.goto(this.parseLiteralString);
862
- }
863
- }
864
- parseLiteralString() {
865
- do {
866
- if (this.char === CHAR_APOS) {
867
- return this.return();
868
- } else if (this.atEndOfLine()) {
869
- throw this.error(new TomlError("Unterminated string"));
870
- } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
871
- throw this.errorControlCharIn("strings");
872
- } else {
873
- this.consume();
874
- }
875
- } while (this.nextChar());
876
- }
877
- parseLiteralMultiStringMaybe() {
878
- if (this.char === CHAR_APOS) {
879
- return this.next(this.parseLiteralMultiString);
880
- } else {
881
- return this.returnNow();
882
- }
883
- }
884
- parseLiteralMultiString() {
885
- if (this.char === CTRL_M) {
886
- return null;
887
- } else if (this.char === CTRL_J) {
888
- return this.next(this.parseLiteralMultiStringContent);
889
- } else {
890
- return this.goto(this.parseLiteralMultiStringContent);
891
- }
892
- }
893
- parseLiteralMultiStringContent() {
894
- do {
895
- if (this.char === CHAR_APOS) {
896
- return this.next(this.parseLiteralMultiEnd);
897
- } else if (this.char === Parser.END) {
898
- throw this.error(new TomlError("Unterminated multi-line string"));
899
- } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
900
- throw this.errorControlCharIn("strings");
901
- } else {
902
- this.consume();
903
- }
904
- } while (this.nextChar());
905
- }
906
- parseLiteralMultiEnd() {
907
- if (this.char === CHAR_APOS) {
908
- return this.next(this.parseLiteralMultiEnd2);
909
- } else {
910
- this.state.buf += "'";
911
- return this.goto(this.parseLiteralMultiStringContent);
912
- }
913
- }
914
- parseLiteralMultiEnd2() {
915
- if (this.char === CHAR_APOS) {
916
- return this.next(this.parseLiteralMultiEnd3);
917
- } else {
918
- this.state.buf += "''";
919
- return this.goto(this.parseLiteralMultiStringContent);
920
- }
921
- }
922
- parseLiteralMultiEnd3() {
923
- if (this.char === CHAR_APOS) {
924
- this.state.buf += "'";
925
- return this.next(this.parseLiteralMultiEnd4);
926
- } else {
927
- return this.returnNow();
928
- }
929
- }
930
- parseLiteralMultiEnd4() {
931
- if (this.char === CHAR_APOS) {
932
- this.state.buf += "'";
933
- return this.return();
934
- } else {
935
- return this.returnNow();
936
- }
937
- }
938
- /* STRINGS double quoted */
939
- parseDoubleString() {
940
- if (this.char === CHAR_QUOT) {
941
- return this.next(this.parseMultiStringMaybe);
942
- } else {
943
- return this.goto(this.parseBasicString);
944
- }
945
- }
946
- parseBasicString() {
947
- do {
948
- if (this.char === CHAR_BSOL) {
949
- return this.call(this.parseEscape, this.recordEscapeReplacement);
950
- } else if (this.char === CHAR_QUOT) {
951
- return this.return();
952
- } else if (this.atEndOfLine()) {
953
- throw this.error(new TomlError("Unterminated string"));
954
- } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
955
- throw this.errorControlCharIn("strings");
956
- } else {
957
- this.consume();
958
- }
959
- } while (this.nextChar());
960
- }
961
- recordEscapeReplacement(replacement) {
962
- this.state.buf += replacement;
963
- return this.goto(this.parseBasicString);
964
- }
965
- parseMultiStringMaybe() {
966
- if (this.char === CHAR_QUOT) {
967
- return this.next(this.parseMultiString);
968
- } else {
969
- return this.returnNow();
970
- }
971
- }
972
- parseMultiString() {
973
- if (this.char === CTRL_M) {
974
- return null;
975
- } else if (this.char === CTRL_J) {
976
- return this.next(this.parseMultiStringContent);
977
- } else {
978
- return this.goto(this.parseMultiStringContent);
979
- }
980
- }
981
- parseMultiStringContent() {
982
- do {
983
- if (this.char === CHAR_BSOL) {
984
- return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement);
985
- } else if (this.char === CHAR_QUOT) {
986
- return this.next(this.parseMultiEnd);
987
- } else if (this.char === Parser.END) {
988
- throw this.error(new TomlError("Unterminated multi-line string"));
989
- } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
990
- throw this.errorControlCharIn("strings");
991
- } else {
992
- this.consume();
993
- }
994
- } while (this.nextChar());
995
- }
996
- errorControlCharIn(type) {
997
- let displayCode = "\\u00";
998
- if (this.char < 16) {
999
- displayCode += "0";
1000
- }
1001
- displayCode += this.char.toString(16);
1002
- return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${type}, use ${displayCode} instead`));
1003
- }
1004
- recordMultiEscapeReplacement(replacement) {
1005
- this.state.buf += replacement;
1006
- return this.goto(this.parseMultiStringContent);
1007
- }
1008
- parseMultiEnd() {
1009
- if (this.char === CHAR_QUOT) {
1010
- return this.next(this.parseMultiEnd2);
1011
- } else {
1012
- this.state.buf += '"';
1013
- return this.goto(this.parseMultiStringContent);
1014
- }
1015
- }
1016
- parseMultiEnd2() {
1017
- if (this.char === CHAR_QUOT) {
1018
- return this.next(this.parseMultiEnd3);
1019
- } else {
1020
- this.state.buf += '""';
1021
- return this.goto(this.parseMultiStringContent);
1022
- }
1023
- }
1024
- parseMultiEnd3() {
1025
- if (this.char === CHAR_QUOT) {
1026
- this.state.buf += '"';
1027
- return this.next(this.parseMultiEnd4);
1028
- } else {
1029
- return this.returnNow();
1030
- }
1031
- }
1032
- parseMultiEnd4() {
1033
- if (this.char === CHAR_QUOT) {
1034
- this.state.buf += '"';
1035
- return this.return();
1036
- } else {
1037
- return this.returnNow();
1038
- }
1039
- }
1040
- parseMultiEscape() {
1041
- if (this.char === CTRL_M || this.char === CTRL_J) {
1042
- return this.next(this.parseMultiTrim);
1043
- } else if (this.char === CHAR_SP || this.char === CTRL_I) {
1044
- return this.next(this.parsePreMultiTrim);
1045
- } else {
1046
- return this.goto(this.parseEscape);
1047
- }
1048
- }
1049
- parsePreMultiTrim() {
1050
- if (this.char === CHAR_SP || this.char === CTRL_I) {
1051
- return null;
1052
- } else if (this.char === CTRL_M || this.char === CTRL_J) {
1053
- return this.next(this.parseMultiTrim);
1054
- } else {
1055
- throw this.error(new TomlError("Can't escape whitespace"));
1056
- }
1057
- }
1058
- parseMultiTrim() {
1059
- if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
1060
- return null;
1061
- } else {
1062
- return this.returnNow();
1063
- }
1064
- }
1065
- parseEscape() {
1066
- if (this.char in escapes) {
1067
- return this.return(escapes[this.char]);
1068
- } else if (this.char === CHAR_u) {
1069
- return this.call(this.parseSmallUnicode, this.parseUnicodeReturn);
1070
- } else if (this.char === CHAR_U) {
1071
- return this.call(this.parseLargeUnicode, this.parseUnicodeReturn);
1072
- } else {
1073
- throw this.error(new TomlError("Unknown escape character: " + this.char));
1074
- }
1075
- }
1076
- parseUnicodeReturn(char) {
1077
- try {
1078
- const codePoint = parseInt(char, 16);
1079
- if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {
1080
- throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));
1081
- }
1082
- return this.returnNow(String.fromCodePoint(codePoint));
1083
- } catch (err) {
1084
- throw this.error(TomlError.wrap(err));
1085
- }
1086
- }
1087
- parseSmallUnicode() {
1088
- if (!isHexit(this.char)) {
1089
- throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
1090
- } else {
1091
- this.consume();
1092
- if (this.state.buf.length >= 4) return this.return();
1093
- }
1094
- }
1095
- parseLargeUnicode() {
1096
- if (!isHexit(this.char)) {
1097
- throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
1098
- } else {
1099
- this.consume();
1100
- if (this.state.buf.length >= 8) return this.return();
1101
- }
1102
- }
1103
- /* NUMBERS */
1104
- parseNumberSign() {
1105
- this.consume();
1106
- return this.next(this.parseMaybeSignedInfOrNan);
1107
- }
1108
- parseMaybeSignedInfOrNan() {
1109
- if (this.char === CHAR_i) {
1110
- return this.next(this.parseInf);
1111
- } else if (this.char === CHAR_n) {
1112
- return this.next(this.parseNan);
1113
- } else {
1114
- return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart);
1115
- }
1116
- }
1117
- parseNumberIntegerStart() {
1118
- if (this.char === CHAR_0) {
1119
- this.consume();
1120
- return this.next(this.parseNumberIntegerExponentOrDecimal);
1121
- } else {
1122
- return this.goto(this.parseNumberInteger);
1123
- }
1124
- }
1125
- parseNumberIntegerExponentOrDecimal() {
1126
- if (this.char === CHAR_PERIOD) {
1127
- this.consume();
1128
- return this.call(this.parseNoUnder, this.parseNumberFloat);
1129
- } else if (this.char === CHAR_E || this.char === CHAR_e) {
1130
- this.consume();
1131
- return this.next(this.parseNumberExponentSign);
1132
- } else {
1133
- return this.returnNow(Integer(this.state.buf));
1134
- }
1135
- }
1136
- parseNumberInteger() {
1137
- if (isDigit(this.char)) {
1138
- this.consume();
1139
- } else if (this.char === CHAR_LOWBAR) {
1140
- return this.call(this.parseNoUnder);
1141
- } else if (this.char === CHAR_E || this.char === CHAR_e) {
1142
- this.consume();
1143
- return this.next(this.parseNumberExponentSign);
1144
- } else if (this.char === CHAR_PERIOD) {
1145
- this.consume();
1146
- return this.call(this.parseNoUnder, this.parseNumberFloat);
1147
- } else {
1148
- const result = Integer(this.state.buf);
1149
- if (result.isNaN()) {
1150
- throw this.error(new TomlError("Invalid number"));
1151
- } else {
1152
- return this.returnNow(result);
1153
- }
1154
- }
1155
- }
1156
- parseNoUnder() {
1157
- if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {
1158
- throw this.error(new TomlError("Unexpected character, expected digit"));
1159
- } else if (this.atEndOfWord()) {
1160
- throw this.error(new TomlError("Incomplete number"));
1161
- }
1162
- return this.returnNow();
1163
- }
1164
- parseNoUnderHexOctBinLiteral() {
1165
- if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {
1166
- throw this.error(new TomlError("Unexpected character, expected digit"));
1167
- } else if (this.atEndOfWord()) {
1168
- throw this.error(new TomlError("Incomplete number"));
1169
- }
1170
- return this.returnNow();
1171
- }
1172
- parseNumberFloat() {
1173
- if (this.char === CHAR_LOWBAR) {
1174
- return this.call(this.parseNoUnder, this.parseNumberFloat);
1175
- } else if (isDigit(this.char)) {
1176
- this.consume();
1177
- } else if (this.char === CHAR_E || this.char === CHAR_e) {
1178
- this.consume();
1179
- return this.next(this.parseNumberExponentSign);
1180
- } else {
1181
- return this.returnNow(Float(this.state.buf));
1182
- }
1183
- }
1184
- parseNumberExponentSign() {
1185
- if (isDigit(this.char)) {
1186
- return this.goto(this.parseNumberExponent);
1187
- } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
1188
- this.consume();
1189
- this.call(this.parseNoUnder, this.parseNumberExponent);
1190
- } else {
1191
- throw this.error(new TomlError("Unexpected character, expected -, + or digit"));
1192
- }
1193
- }
1194
- parseNumberExponent() {
1195
- if (isDigit(this.char)) {
1196
- this.consume();
1197
- } else if (this.char === CHAR_LOWBAR) {
1198
- return this.call(this.parseNoUnder);
1199
- } else {
1200
- return this.returnNow(Float(this.state.buf));
1201
- }
1202
- }
1203
- /* NUMBERS or DATETIMES */
1204
- parseNumberOrDateTime() {
1205
- if (this.char === CHAR_0) {
1206
- this.consume();
1207
- return this.next(this.parseNumberBaseOrDateTime);
1208
- } else {
1209
- return this.goto(this.parseNumberOrDateTimeOnly);
1210
- }
1211
- }
1212
- parseNumberOrDateTimeOnly() {
1213
- if (this.char === CHAR_LOWBAR) {
1214
- return this.call(this.parseNoUnder, this.parseNumberInteger);
1215
- } else if (isDigit(this.char)) {
1216
- this.consume();
1217
- if (this.state.buf.length > 4) this.next(this.parseNumberInteger);
1218
- } else if (this.char === CHAR_E || this.char === CHAR_e) {
1219
- this.consume();
1220
- return this.next(this.parseNumberExponentSign);
1221
- } else if (this.char === CHAR_PERIOD) {
1222
- this.consume();
1223
- return this.call(this.parseNoUnder, this.parseNumberFloat);
1224
- } else if (this.char === CHAR_HYPHEN) {
1225
- return this.goto(this.parseDateTime);
1226
- } else if (this.char === CHAR_COLON) {
1227
- return this.goto(this.parseOnlyTimeHour);
1228
- } else {
1229
- return this.returnNow(Integer(this.state.buf));
1230
- }
1231
- }
1232
- parseDateTimeOnly() {
1233
- if (this.state.buf.length < 4) {
1234
- if (isDigit(this.char)) {
1235
- return this.consume();
1236
- } else if (this.char === CHAR_COLON) {
1237
- return this.goto(this.parseOnlyTimeHour);
1238
- } else {
1239
- throw this.error(new TomlError("Expected digit while parsing year part of a date"));
1240
- }
1241
- } else {
1242
- if (this.char === CHAR_HYPHEN) {
1243
- return this.goto(this.parseDateTime);
1244
- } else {
1245
- throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"));
1246
- }
1247
- }
1248
- }
1249
- parseNumberBaseOrDateTime() {
1250
- if (this.char === CHAR_b) {
1251
- this.consume();
1252
- return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin);
1253
- } else if (this.char === CHAR_o) {
1254
- this.consume();
1255
- return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct);
1256
- } else if (this.char === CHAR_x) {
1257
- this.consume();
1258
- return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex);
1259
- } else if (this.char === CHAR_PERIOD) {
1260
- return this.goto(this.parseNumberInteger);
1261
- } else if (isDigit(this.char)) {
1262
- return this.goto(this.parseDateTimeOnly);
1263
- } else {
1264
- return this.returnNow(Integer(this.state.buf));
1265
- }
1266
- }
1267
- parseIntegerHex() {
1268
- if (isHexit(this.char)) {
1269
- this.consume();
1270
- } else if (this.char === CHAR_LOWBAR) {
1271
- return this.call(this.parseNoUnderHexOctBinLiteral);
1272
- } else {
1273
- const result = Integer(this.state.buf);
1274
- if (result.isNaN()) {
1275
- throw this.error(new TomlError("Invalid number"));
1276
- } else {
1277
- return this.returnNow(result);
1278
- }
1279
- }
1280
- }
1281
- parseIntegerOct() {
1282
- if (isOctit(this.char)) {
1283
- this.consume();
1284
- } else if (this.char === CHAR_LOWBAR) {
1285
- return this.call(this.parseNoUnderHexOctBinLiteral);
1286
- } else {
1287
- const result = Integer(this.state.buf);
1288
- if (result.isNaN()) {
1289
- throw this.error(new TomlError("Invalid number"));
1290
- } else {
1291
- return this.returnNow(result);
1292
- }
1293
- }
1294
- }
1295
- parseIntegerBin() {
1296
- if (isBit(this.char)) {
1297
- this.consume();
1298
- } else if (this.char === CHAR_LOWBAR) {
1299
- return this.call(this.parseNoUnderHexOctBinLiteral);
1300
- } else {
1301
- const result = Integer(this.state.buf);
1302
- if (result.isNaN()) {
1303
- throw this.error(new TomlError("Invalid number"));
1304
- } else {
1305
- return this.returnNow(result);
1306
- }
1307
- }
1308
- }
1309
- /* DATETIME */
1310
- parseDateTime() {
1311
- if (this.state.buf.length < 4) {
1312
- throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));
1313
- }
1314
- this.state.result = this.state.buf;
1315
- this.state.buf = "";
1316
- return this.next(this.parseDateMonth);
1317
- }
1318
- parseDateMonth() {
1319
- if (this.char === CHAR_HYPHEN) {
1320
- if (this.state.buf.length < 2) {
1321
- throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));
1322
- }
1323
- this.state.result += "-" + this.state.buf;
1324
- this.state.buf = "";
1325
- return this.next(this.parseDateDay);
1326
- } else if (isDigit(this.char)) {
1327
- this.consume();
1328
- } else {
1329
- throw this.error(new TomlError("Incomplete datetime"));
1330
- }
1331
- }
1332
- parseDateDay() {
1333
- if (this.char === CHAR_T || this.char === CHAR_SP) {
1334
- if (this.state.buf.length < 2) {
1335
- throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));
1336
- }
1337
- this.state.result += "-" + this.state.buf;
1338
- this.state.buf = "";
1339
- return this.next(this.parseStartTimeHour);
1340
- } else if (this.atEndOfWord()) {
1341
- return this.returnNow(createDate(this.state.result + "-" + this.state.buf));
1342
- } else if (isDigit(this.char)) {
1343
- this.consume();
1344
- } else {
1345
- throw this.error(new TomlError("Incomplete datetime"));
1346
- }
1347
- }
1348
- parseStartTimeHour() {
1349
- if (this.atEndOfWord()) {
1350
- return this.returnNow(createDate(this.state.result));
1351
- } else {
1352
- return this.goto(this.parseTimeHour);
1353
- }
1354
- }
1355
- parseTimeHour() {
1356
- if (this.char === CHAR_COLON) {
1357
- if (this.state.buf.length < 2) {
1358
- throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
1359
- }
1360
- this.state.result += "T" + this.state.buf;
1361
- this.state.buf = "";
1362
- return this.next(this.parseTimeMin);
1363
- } else if (isDigit(this.char)) {
1364
- this.consume();
1365
- } else {
1366
- throw this.error(new TomlError("Incomplete datetime"));
1367
- }
1368
- }
1369
- parseTimeMin() {
1370
- if (this.state.buf.length < 2 && isDigit(this.char)) {
1371
- this.consume();
1372
- } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
1373
- this.state.result += ":" + this.state.buf;
1374
- this.state.buf = "";
1375
- return this.next(this.parseTimeSec);
1376
- } else {
1377
- throw this.error(new TomlError("Incomplete datetime"));
1378
- }
1379
- }
1380
- parseTimeSec() {
1381
- if (isDigit(this.char)) {
1382
- this.consume();
1383
- if (this.state.buf.length === 2) {
1384
- this.state.result += ":" + this.state.buf;
1385
- this.state.buf = "";
1386
- return this.next(this.parseTimeZoneOrFraction);
1387
- }
1388
- } else {
1389
- throw this.error(new TomlError("Incomplete datetime"));
1390
- }
1391
- }
1392
- parseOnlyTimeHour() {
1393
- if (this.char === CHAR_COLON) {
1394
- if (this.state.buf.length < 2) {
1395
- throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
1396
- }
1397
- this.state.result = this.state.buf;
1398
- this.state.buf = "";
1399
- return this.next(this.parseOnlyTimeMin);
1400
- } else {
1401
- throw this.error(new TomlError("Incomplete time"));
1402
- }
1403
- }
1404
- parseOnlyTimeMin() {
1405
- if (this.state.buf.length < 2 && isDigit(this.char)) {
1406
- this.consume();
1407
- } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
1408
- this.state.result += ":" + this.state.buf;
1409
- this.state.buf = "";
1410
- return this.next(this.parseOnlyTimeSec);
1411
- } else {
1412
- throw this.error(new TomlError("Incomplete time"));
1413
- }
1414
- }
1415
- parseOnlyTimeSec() {
1416
- if (isDigit(this.char)) {
1417
- this.consume();
1418
- if (this.state.buf.length === 2) {
1419
- return this.next(this.parseOnlyTimeFractionMaybe);
1420
- }
1421
- } else {
1422
- throw this.error(new TomlError("Incomplete time"));
1423
- }
1424
- }
1425
- parseOnlyTimeFractionMaybe() {
1426
- this.state.result += ":" + this.state.buf;
1427
- if (this.char === CHAR_PERIOD) {
1428
- this.state.buf = "";
1429
- this.next(this.parseOnlyTimeFraction);
1430
- } else {
1431
- return this.return(createTime(this.state.result));
1432
- }
1433
- }
1434
- parseOnlyTimeFraction() {
1435
- if (isDigit(this.char)) {
1436
- this.consume();
1437
- } else if (this.atEndOfWord()) {
1438
- if (this.state.buf.length === 0) throw this.error(new TomlError("Expected digit in milliseconds"));
1439
- return this.returnNow(createTime(this.state.result + "." + this.state.buf));
1440
- } else {
1441
- throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
1442
- }
1443
- }
1444
- parseTimeZoneOrFraction() {
1445
- if (this.char === CHAR_PERIOD) {
1446
- this.consume();
1447
- this.next(this.parseDateTimeFraction);
1448
- } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
1449
- this.consume();
1450
- this.next(this.parseTimeZoneHour);
1451
- } else if (this.char === CHAR_Z) {
1452
- this.consume();
1453
- return this.return(createDateTime(this.state.result + this.state.buf));
1454
- } else if (this.atEndOfWord()) {
1455
- return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
1456
- } else {
1457
- throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
1458
- }
1459
- }
1460
- parseDateTimeFraction() {
1461
- if (isDigit(this.char)) {
1462
- this.consume();
1463
- } else if (this.state.buf.length === 1) {
1464
- throw this.error(new TomlError("Expected digit in milliseconds"));
1465
- } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
1466
- this.consume();
1467
- this.next(this.parseTimeZoneHour);
1468
- } else if (this.char === CHAR_Z) {
1469
- this.consume();
1470
- return this.return(createDateTime(this.state.result + this.state.buf));
1471
- } else if (this.atEndOfWord()) {
1472
- return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
1473
- } else {
1474
- throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
1475
- }
1476
- }
1477
- parseTimeZoneHour() {
1478
- if (isDigit(this.char)) {
1479
- this.consume();
1480
- if (/\d\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep);
1481
- } else {
1482
- throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
1483
- }
1484
- }
1485
- parseTimeZoneSep() {
1486
- if (this.char === CHAR_COLON) {
1487
- this.consume();
1488
- this.next(this.parseTimeZoneMin);
1489
- } else {
1490
- throw this.error(new TomlError("Unexpected character in datetime, expected colon"));
1491
- }
1492
- }
1493
- parseTimeZoneMin() {
1494
- if (isDigit(this.char)) {
1495
- this.consume();
1496
- if (/\d\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf));
1497
- } else {
1498
- throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
1499
- }
1500
- }
1501
- /* BOOLEAN */
1502
- parseBoolean() {
1503
- if (this.char === CHAR_t) {
1504
- this.consume();
1505
- return this.next(this.parseTrue_r);
1506
- } else if (this.char === CHAR_f) {
1507
- this.consume();
1508
- return this.next(this.parseFalse_a);
1509
- }
1510
- }
1511
- parseTrue_r() {
1512
- if (this.char === CHAR_r) {
1513
- this.consume();
1514
- return this.next(this.parseTrue_u);
1515
- } else {
1516
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1517
- }
1518
- }
1519
- parseTrue_u() {
1520
- if (this.char === CHAR_u) {
1521
- this.consume();
1522
- return this.next(this.parseTrue_e);
1523
- } else {
1524
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1525
- }
1526
- }
1527
- parseTrue_e() {
1528
- if (this.char === CHAR_e) {
1529
- return this.return(true);
1530
- } else {
1531
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1532
- }
1533
- }
1534
- parseFalse_a() {
1535
- if (this.char === CHAR_a) {
1536
- this.consume();
1537
- return this.next(this.parseFalse_l);
1538
- } else {
1539
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1540
- }
1541
- }
1542
- parseFalse_l() {
1543
- if (this.char === CHAR_l) {
1544
- this.consume();
1545
- return this.next(this.parseFalse_s);
1546
- } else {
1547
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1548
- }
1549
- }
1550
- parseFalse_s() {
1551
- if (this.char === CHAR_s) {
1552
- this.consume();
1553
- return this.next(this.parseFalse_e);
1554
- } else {
1555
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1556
- }
1557
- }
1558
- parseFalse_e() {
1559
- if (this.char === CHAR_e) {
1560
- return this.return(false);
1561
- } else {
1562
- throw this.error(new TomlError("Invalid boolean, expected true or false"));
1563
- }
1564
- }
1565
- /* INLINE LISTS */
1566
- parseInlineList() {
1567
- if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
1568
- return null;
1569
- } else if (this.char === Parser.END) {
1570
- throw this.error(new TomlError("Unterminated inline array"));
1571
- } else if (this.char === CHAR_NUM) {
1572
- return this.call(this.parseComment);
1573
- } else if (this.char === CHAR_RSQB) {
1574
- return this.return(this.state.resultArr || InlineList());
1575
- } else {
1576
- return this.callNow(this.parseValue, this.recordInlineListValue);
1577
- }
1578
- }
1579
- recordInlineListValue(value) {
1580
- if (!this.state.resultArr) {
1581
- this.state.resultArr = InlineList(tomlType(value));
1582
- }
1583
- if (isFloat(value) || isInteger(value)) {
1584
- this.state.resultArr.push(value.valueOf());
1585
- } else {
1586
- this.state.resultArr.push(value);
1587
- }
1588
- return this.goto(this.parseInlineListNext);
1589
- }
1590
- parseInlineListNext() {
1591
- if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
1592
- return null;
1593
- } else if (this.char === CHAR_NUM) {
1594
- return this.call(this.parseComment);
1595
- } else if (this.char === CHAR_COMMA) {
1596
- return this.next(this.parseInlineList);
1597
- } else if (this.char === CHAR_RSQB) {
1598
- return this.goto(this.parseInlineList);
1599
- } else {
1600
- throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
1601
- }
1602
- }
1603
- /* INLINE TABLE */
1604
- parseInlineTable() {
1605
- if (this.char === CHAR_SP || this.char === CTRL_I) {
1606
- return null;
1607
- } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
1608
- throw this.error(new TomlError("Unterminated inline array"));
1609
- } else if (this.char === CHAR_RCUB) {
1610
- return this.return(this.state.resultTable || InlineTable());
1611
- } else {
1612
- if (!this.state.resultTable) this.state.resultTable = InlineTable();
1613
- return this.callNow(this.parseAssign, this.recordInlineTableValue);
1614
- }
1615
- }
1616
- recordInlineTableValue(kv) {
1617
- let target = this.state.resultTable;
1618
- let finalKey = kv.key.pop();
1619
- for (let kw of kv.key) {
1620
- if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
1621
- throw this.error(new TomlError("Can't redefine existing key"));
1622
- }
1623
- target = target[kw] = target[kw] || Table();
1624
- }
1625
- if (hasKey(target, finalKey)) {
1626
- throw this.error(new TomlError("Can't redefine existing key"));
1627
- }
1628
- if (isInteger(kv.value) || isFloat(kv.value)) {
1629
- target[finalKey] = kv.value.valueOf();
1630
- } else {
1631
- target[finalKey] = kv.value;
1632
- }
1633
- return this.goto(this.parseInlineTableNext);
1634
- }
1635
- parseInlineTableNext() {
1636
- if (this.char === CHAR_SP || this.char === CTRL_I) {
1637
- return null;
1638
- } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
1639
- throw this.error(new TomlError("Unterminated inline array"));
1640
- } else if (this.char === CHAR_COMMA) {
1641
- return this.next(this.parseInlineTablePostComma);
1642
- } else if (this.char === CHAR_RCUB) {
1643
- return this.goto(this.parseInlineTable);
1644
- } else {
1645
- throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
1646
- }
1647
- }
1648
- parseInlineTablePostComma() {
1649
- if (this.char === CHAR_SP || this.char === CTRL_I) {
1650
- return null;
1651
- } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
1652
- throw this.error(new TomlError("Unterminated inline array"));
1653
- } else if (this.char === CHAR_COMMA) {
1654
- throw this.error(new TomlError("Empty elements in inline tables are not permitted"));
1655
- } else if (this.char === CHAR_RCUB) {
1656
- throw this.error(new TomlError("Trailing commas in inline tables are not permitted"));
1657
- } else {
1658
- return this.goto(this.parseInlineTable);
1659
- }
1660
- }
1661
- }
1662
- return TOMLParser;
1663
- }
1664
- __name(makeParserClass, "makeParserClass");
1665
- }
1666
- });
1667
-
1668
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js
1669
- var require_parse_pretty_error = __commonJS({
1670
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js"(exports2, module2) {
1671
- module2.exports = prettyError;
1672
- function prettyError(err, buf) {
1673
- if (err.pos == null || err.line == null) return err;
1674
- let msg = err.message;
1675
- msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:
1676
- `;
1677
- if (buf && buf.split) {
1678
- const lines = buf.split(/\n/);
1679
- const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
1680
- let linePadding = " ";
1681
- while (linePadding.length < lineNumWidth) linePadding += " ";
1682
- for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
1683
- let lineNum = String(ii + 1);
1684
- if (lineNum.length < lineNumWidth) lineNum = " " + lineNum;
1685
- if (err.line === ii) {
1686
- msg += lineNum + "> " + lines[ii] + "\n";
1687
- msg += linePadding + " ";
1688
- for (let hh = 0; hh < err.col; ++hh) {
1689
- msg += " ";
1690
- }
1691
- msg += "^\n";
1692
- } else {
1693
- msg += lineNum + ": " + lines[ii] + "\n";
1694
- }
1695
- }
1696
- }
1697
- err.message = msg + "\n";
1698
- return err;
1699
- }
1700
- __name(prettyError, "prettyError");
1701
- }
1702
- });
1703
-
1704
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js
1705
- var require_parse_string = __commonJS({
1706
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js"(exports2, module2) {
1707
- module2.exports = parseString;
1708
- var TOMLParser = require_toml_parser();
1709
- var prettyError = require_parse_pretty_error();
1710
- function parseString(str) {
1711
- if (global.Buffer && global.Buffer.isBuffer(str)) {
1712
- str = str.toString("utf8");
1713
- }
1714
- const parser = new TOMLParser();
1715
- try {
1716
- parser.parse(str);
1717
- return parser.finish();
1718
- } catch (err) {
1719
- throw prettyError(err, str);
1720
- }
1721
- }
1722
- __name(parseString, "parseString");
1723
- }
1724
- });
1725
-
1726
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js
1727
- var require_parse_async = __commonJS({
1728
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js"(exports2, module2) {
1729
- module2.exports = parseAsync;
1730
- var TOMLParser = require_toml_parser();
1731
- var prettyError = require_parse_pretty_error();
1732
- function parseAsync(str, opts) {
1733
- if (!opts) opts = {};
1734
- const index = 0;
1735
- const blocksize = opts.blocksize || 40960;
1736
- const parser = new TOMLParser();
1737
- return new Promise((resolve2, reject) => {
1738
- setImmediate(parseAsyncNext, index, blocksize, resolve2, reject);
1739
- });
1740
- function parseAsyncNext(index2, blocksize2, resolve2, reject) {
1741
- if (index2 >= str.length) {
1742
- try {
1743
- return resolve2(parser.finish());
1744
- } catch (err) {
1745
- return reject(prettyError(err, str));
1746
- }
1747
- }
1748
- try {
1749
- parser.parse(str.slice(index2, index2 + blocksize2));
1750
- setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve2, reject);
1751
- } catch (err) {
1752
- reject(prettyError(err, str));
1753
- }
1754
- }
1755
- }
1756
- __name(parseAsync, "parseAsync");
1757
- }
1758
- });
1759
-
1760
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js
1761
- var require_parse_stream = __commonJS({
1762
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js"(exports2, module2) {
1763
- module2.exports = parseStream;
1764
- var stream = __require("stream");
1765
- var TOMLParser = require_toml_parser();
1766
- function parseStream(stm) {
1767
- if (stm) {
1768
- return parseReadable(stm);
1769
- } else {
1770
- return parseTransform();
1771
- }
1772
- }
1773
- __name(parseStream, "parseStream");
1774
- function parseReadable(stm) {
1775
- const parser = new TOMLParser();
1776
- stm.setEncoding("utf8");
1777
- return new Promise((resolve2, reject) => {
1778
- let readable;
1779
- let ended = false;
1780
- let errored = false;
1781
- function finish() {
1782
- ended = true;
1783
- if (readable) return;
1784
- try {
1785
- resolve2(parser.finish());
1786
- } catch (err) {
1787
- reject(err);
1788
- }
1789
- }
1790
- __name(finish, "finish");
1791
- function error(err) {
1792
- errored = true;
1793
- reject(err);
1794
- }
1795
- __name(error, "error");
1796
- stm.once("end", finish);
1797
- stm.once("error", error);
1798
- readNext();
1799
- function readNext() {
1800
- readable = true;
1801
- let data;
1802
- while ((data = stm.read()) !== null) {
1803
- try {
1804
- parser.parse(data);
1805
- } catch (err) {
1806
- return error(err);
1807
- }
1808
- }
1809
- readable = false;
1810
- if (ended) return finish();
1811
- if (errored) return;
1812
- stm.once("readable", readNext);
1813
- }
1814
- __name(readNext, "readNext");
1815
- });
1816
- }
1817
- __name(parseReadable, "parseReadable");
1818
- function parseTransform() {
1819
- const parser = new TOMLParser();
1820
- return new stream.Transform({
1821
- objectMode: true,
1822
- transform(chunk, encoding, cb) {
1823
- try {
1824
- parser.parse(chunk.toString(encoding));
1825
- } catch (err) {
1826
- this.emit("error", err);
1827
- }
1828
- cb();
1829
- },
1830
- flush(cb) {
1831
- try {
1832
- this.push(parser.finish());
1833
- } catch (err) {
1834
- this.emit("error", err);
1835
- }
1836
- cb();
1837
- }
1838
- });
1839
- }
1840
- __name(parseTransform, "parseTransform");
1841
- }
1842
- });
1843
-
1844
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js
1845
- var require_parse = __commonJS({
1846
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js"(exports2, module2) {
1847
- module2.exports = require_parse_string();
1848
- module2.exports.async = require_parse_async();
1849
- module2.exports.stream = require_parse_stream();
1850
- module2.exports.prettyError = require_parse_pretty_error();
1851
- }
1852
- });
1853
-
1854
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js
1855
- var require_stringify = __commonJS({
1856
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js"(exports2, module2) {
1857
- module2.exports = stringify;
1858
- module2.exports.value = stringifyInline;
1859
- function stringify(obj) {
1860
- if (obj === null) throw typeError("null");
1861
- if (obj === void 0) throw typeError("undefined");
1862
- if (typeof obj !== "object") throw typeError(typeof obj);
1863
- if (typeof obj.toJSON === "function") obj = obj.toJSON();
1864
- if (obj == null) return null;
1865
- const type = tomlType2(obj);
1866
- if (type !== "table") throw typeError(type);
1867
- return stringifyObject("", "", obj);
1868
- }
1869
- __name(stringify, "stringify");
1870
- function typeError(type) {
1871
- return new Error("Can only stringify objects, not " + type);
1872
- }
1873
- __name(typeError, "typeError");
1874
- function getInlineKeys(obj) {
1875
- return Object.keys(obj).filter((key) => isInline(obj[key]));
1876
- }
1877
- __name(getInlineKeys, "getInlineKeys");
1878
- function getComplexKeys(obj) {
1879
- return Object.keys(obj).filter((key) => !isInline(obj[key]));
1880
- }
1881
- __name(getComplexKeys, "getComplexKeys");
1882
- function toJSON(obj) {
1883
- let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, "__proto__") ? { ["__proto__"]: void 0 } : {};
1884
- for (let prop of Object.keys(obj)) {
1885
- if (obj[prop] && typeof obj[prop].toJSON === "function" && !("toISOString" in obj[prop])) {
1886
- nobj[prop] = obj[prop].toJSON();
1887
- } else {
1888
- nobj[prop] = obj[prop];
1889
- }
1890
- }
1891
- return nobj;
1892
- }
1893
- __name(toJSON, "toJSON");
1894
- function stringifyObject(prefix, indent, obj) {
1895
- obj = toJSON(obj);
1896
- let inlineKeys;
1897
- let complexKeys;
1898
- inlineKeys = getInlineKeys(obj);
1899
- complexKeys = getComplexKeys(obj);
1900
- const result = [];
1901
- const inlineIndent = indent || "";
1902
- inlineKeys.forEach((key) => {
1903
- var type = tomlType2(obj[key]);
1904
- if (type !== "undefined" && type !== "null") {
1905
- result.push(inlineIndent + stringifyKey(key) + " = " + stringifyAnyInline(obj[key], true));
1906
- }
1907
- });
1908
- if (result.length > 0) result.push("");
1909
- const complexIndent = prefix && inlineKeys.length > 0 ? indent + " " : "";
1910
- complexKeys.forEach((key) => {
1911
- result.push(stringifyComplex(prefix, complexIndent, key, obj[key]));
1912
- });
1913
- return result.join("\n");
1914
- }
1915
- __name(stringifyObject, "stringifyObject");
1916
- function isInline(value) {
1917
- switch (tomlType2(value)) {
1918
- case "undefined":
1919
- case "null":
1920
- case "integer":
1921
- case "nan":
1922
- case "float":
1923
- case "boolean":
1924
- case "string":
1925
- case "datetime":
1926
- return true;
1927
- case "array":
1928
- return value.length === 0 || tomlType2(value[0]) !== "table";
1929
- case "table":
1930
- return Object.keys(value).length === 0;
1931
- /* istanbul ignore next */
1932
- default:
1933
- return false;
1934
- }
1935
- }
1936
- __name(isInline, "isInline");
1937
- function tomlType2(value) {
1938
- if (value === void 0) {
1939
- return "undefined";
1940
- } else if (value === null) {
1941
- return "null";
1942
- } else if (typeof value === "bigint" || Number.isInteger(value) && !Object.is(value, -0)) {
1943
- return "integer";
1944
- } else if (typeof value === "number") {
1945
- return "float";
1946
- } else if (typeof value === "boolean") {
1947
- return "boolean";
1948
- } else if (typeof value === "string") {
1949
- return "string";
1950
- } else if ("toISOString" in value) {
1951
- return isNaN(value) ? "undefined" : "datetime";
1952
- } else if (Array.isArray(value)) {
1953
- return "array";
1954
- } else {
1955
- return "table";
1956
- }
1957
- }
1958
- __name(tomlType2, "tomlType");
1959
- function stringifyKey(key) {
1960
- const keyStr = String(key);
1961
- if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {
1962
- return keyStr;
1963
- } else {
1964
- return stringifyBasicString(keyStr);
1965
- }
1966
- }
1967
- __name(stringifyKey, "stringifyKey");
1968
- function stringifyBasicString(str) {
1969
- return '"' + escapeString(str).replace(/"/g, '\\"') + '"';
1970
- }
1971
- __name(stringifyBasicString, "stringifyBasicString");
1972
- function stringifyLiteralString(str) {
1973
- return "'" + str + "'";
1974
- }
1975
- __name(stringifyLiteralString, "stringifyLiteralString");
1976
- function numpad(num, str) {
1977
- while (str.length < num) str = "0" + str;
1978
- return str;
1979
- }
1980
- __name(numpad, "numpad");
1981
- function escapeString(str) {
1982
- return str.replace(/\\/g, "\\\\").replace(/[\b]/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/([\u0000-\u001f\u007f])/, (c) => "\\u" + numpad(4, c.codePointAt(0).toString(16)));
1983
- }
1984
- __name(escapeString, "escapeString");
1985
- function stringifyMultilineString(str) {
1986
- let escaped = str.split(/\n/).map((str2) => {
1987
- return escapeString(str2).replace(/"(?="")/g, '\\"');
1988
- }).join("\n");
1989
- if (escaped.slice(-1) === '"') escaped += "\\\n";
1990
- return '"""\n' + escaped + '"""';
1991
- }
1992
- __name(stringifyMultilineString, "stringifyMultilineString");
1993
- function stringifyAnyInline(value, multilineOk) {
1994
- let type = tomlType2(value);
1995
- if (type === "string") {
1996
- if (multilineOk && /\n/.test(value)) {
1997
- type = "string-multiline";
1998
- } else if (!/[\b\t\n\f\r']/.test(value) && /"/.test(value)) {
1999
- type = "string-literal";
2000
- }
2001
- }
2002
- return stringifyInline(value, type);
2003
- }
2004
- __name(stringifyAnyInline, "stringifyAnyInline");
2005
- function stringifyInline(value, type) {
2006
- if (!type) type = tomlType2(value);
2007
- switch (type) {
2008
- case "string-multiline":
2009
- return stringifyMultilineString(value);
2010
- case "string":
2011
- return stringifyBasicString(value);
2012
- case "string-literal":
2013
- return stringifyLiteralString(value);
2014
- case "integer":
2015
- return stringifyInteger(value);
2016
- case "float":
2017
- return stringifyFloat(value);
2018
- case "boolean":
2019
- return stringifyBoolean(value);
2020
- case "datetime":
2021
- return stringifyDatetime(value);
2022
- case "array":
2023
- return stringifyInlineArray(value.filter((_) => tomlType2(_) !== "null" && tomlType2(_) !== "undefined" && tomlType2(_) !== "nan"));
2024
- case "table":
2025
- return stringifyInlineTable(value);
2026
- /* istanbul ignore next */
2027
- default:
2028
- throw typeError(type);
2029
- }
2030
- }
2031
- __name(stringifyInline, "stringifyInline");
2032
- function stringifyInteger(value) {
2033
- return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, "_");
2034
- }
2035
- __name(stringifyInteger, "stringifyInteger");
2036
- function stringifyFloat(value) {
2037
- if (value === Infinity) {
2038
- return "inf";
2039
- } else if (value === -Infinity) {
2040
- return "-inf";
2041
- } else if (Object.is(value, NaN)) {
2042
- return "nan";
2043
- } else if (Object.is(value, -0)) {
2044
- return "-0.0";
2045
- }
2046
- const [int, dec] = String(value).split(".");
2047
- return stringifyInteger(int) + "." + dec;
2048
- }
2049
- __name(stringifyFloat, "stringifyFloat");
2050
- function stringifyBoolean(value) {
2051
- return String(value);
2052
- }
2053
- __name(stringifyBoolean, "stringifyBoolean");
2054
- function stringifyDatetime(value) {
2055
- return value.toISOString();
2056
- }
2057
- __name(stringifyDatetime, "stringifyDatetime");
2058
- function stringifyInlineArray(values) {
2059
- values = toJSON(values);
2060
- let result = "[";
2061
- const stringified = values.map((_) => stringifyInline(_));
2062
- if (stringified.join(", ").length > 60 || /\n/.test(stringified)) {
2063
- result += "\n " + stringified.join(",\n ") + "\n";
2064
- } else {
2065
- result += " " + stringified.join(", ") + (stringified.length > 0 ? " " : "");
2066
- }
2067
- return result + "]";
2068
- }
2069
- __name(stringifyInlineArray, "stringifyInlineArray");
2070
- function stringifyInlineTable(value) {
2071
- value = toJSON(value);
2072
- const result = [];
2073
- Object.keys(value).forEach((key) => {
2074
- result.push(stringifyKey(key) + " = " + stringifyAnyInline(value[key], false));
2075
- });
2076
- return "{ " + result.join(", ") + (result.length > 0 ? " " : "") + "}";
2077
- }
2078
- __name(stringifyInlineTable, "stringifyInlineTable");
2079
- function stringifyComplex(prefix, indent, key, value) {
2080
- const valueType = tomlType2(value);
2081
- if (valueType === "array") {
2082
- return stringifyArrayOfTables(prefix, indent, key, value);
2083
- } else if (valueType === "table") {
2084
- return stringifyComplexTable(prefix, indent, key, value);
2085
- } else {
2086
- throw typeError(valueType);
2087
- }
2088
- }
2089
- __name(stringifyComplex, "stringifyComplex");
2090
- function stringifyArrayOfTables(prefix, indent, key, values) {
2091
- values = toJSON(values);
2092
- const firstValueType = tomlType2(values[0]);
2093
- if (firstValueType !== "table") throw typeError(firstValueType);
2094
- const fullKey = prefix + stringifyKey(key);
2095
- let result = "";
2096
- values.forEach((table) => {
2097
- if (result.length > 0) result += "\n";
2098
- result += indent + "[[" + fullKey + "]]\n";
2099
- result += stringifyObject(fullKey + ".", indent, table);
2100
- });
2101
- return result;
2102
- }
2103
- __name(stringifyArrayOfTables, "stringifyArrayOfTables");
2104
- function stringifyComplexTable(prefix, indent, key, value) {
2105
- const fullKey = prefix + stringifyKey(key);
2106
- let result = "";
2107
- if (getInlineKeys(value).length > 0) {
2108
- result += indent + "[" + fullKey + "]\n";
2109
- }
2110
- return result + stringifyObject(fullKey + ".", indent, value);
2111
- }
2112
- __name(stringifyComplexTable, "stringifyComplexTable");
2113
- }
2114
- });
2115
-
2116
- // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js
2117
- var require_toml = __commonJS({
2118
- "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js"(exports2) {
2119
- exports2.parse = require_parse();
2120
- exports2.stringify = require_stringify();
2121
- }
2122
- });
2123
-
2124
11
  // src/config/config.ts
2125
12
  var defaultWranglerConfig = {
2126
13
  /* COMPUTED_FIELDS */
@@ -2230,15 +117,887 @@ var defaultWranglerConfig = {
2230
117
  unsafe: {},
2231
118
  mtls_certificates: [],
2232
119
  tail_consumers: void 0,
120
+ streaming_tail_consumers: void 0,
2233
121
  pipelines: [],
2234
122
  vpc_services: []
2235
123
  };
2236
124
 
2237
- // src/config/index.ts
2238
- var import_toml2 = __toESM(require_toml());
125
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js
126
+ function getLineColFromPtr(string, ptr) {
127
+ let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
128
+ return [lines.length, lines.pop().length + 1];
129
+ }
130
+ __name(getLineColFromPtr, "getLineColFromPtr");
131
+ function makeCodeBlock(string, line, column) {
132
+ let lines = string.split(/\r\n|\n|\r/g);
133
+ let codeblock = "";
134
+ let numberLen = (Math.log10(line + 1) | 0) + 1;
135
+ for (let i = line - 1; i <= line + 1; i++) {
136
+ let l = lines[i - 1];
137
+ if (!l)
138
+ continue;
139
+ codeblock += i.toString().padEnd(numberLen, " ");
140
+ codeblock += ": ";
141
+ codeblock += l;
142
+ codeblock += "\n";
143
+ if (i === line) {
144
+ codeblock += " ".repeat(numberLen + column + 2);
145
+ codeblock += "^\n";
146
+ }
147
+ }
148
+ return codeblock;
149
+ }
150
+ __name(makeCodeBlock, "makeCodeBlock");
151
+ var TomlError = class extends Error {
152
+ static {
153
+ __name(this, "TomlError");
154
+ }
155
+ line;
156
+ column;
157
+ codeblock;
158
+ constructor(message, options) {
159
+ const [line, column] = getLineColFromPtr(options.toml, options.ptr);
160
+ const codeblock = makeCodeBlock(options.toml, line, column);
161
+ super(`Invalid TOML document: ${message}
162
+
163
+ ${codeblock}`, options);
164
+ this.line = line;
165
+ this.column = column;
166
+ this.codeblock = codeblock;
167
+ }
168
+ };
169
+
170
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js
171
+ function isEscaped(str, ptr) {
172
+ let i = 0;
173
+ while (str[ptr - ++i] === "\\")
174
+ ;
175
+ return --i && i % 2;
176
+ }
177
+ __name(isEscaped, "isEscaped");
178
+ function indexOfNewline(str, start = 0, end = str.length) {
179
+ let idx = str.indexOf("\n", start);
180
+ if (str[idx - 1] === "\r")
181
+ idx--;
182
+ return idx <= end ? idx : -1;
183
+ }
184
+ __name(indexOfNewline, "indexOfNewline");
185
+ function skipComment(str, ptr) {
186
+ for (let i = ptr; i < str.length; i++) {
187
+ let c = str[i];
188
+ if (c === "\n")
189
+ return i;
190
+ if (c === "\r" && str[i + 1] === "\n")
191
+ return i + 1;
192
+ if (c < " " && c !== " " || c === "\x7F") {
193
+ throw new TomlError("control characters are not allowed in comments", {
194
+ toml: str,
195
+ ptr
196
+ });
197
+ }
198
+ }
199
+ return str.length;
200
+ }
201
+ __name(skipComment, "skipComment");
202
+ function skipVoid(str, ptr, banNewLines, banComments) {
203
+ let c;
204
+ while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n"))
205
+ ptr++;
206
+ return banComments || c !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
207
+ }
208
+ __name(skipVoid, "skipVoid");
209
+ function skipUntil(str, ptr, sep, end, banNewLines = false) {
210
+ if (!end) {
211
+ ptr = indexOfNewline(str, ptr);
212
+ return ptr < 0 ? str.length : ptr;
213
+ }
214
+ for (let i = ptr; i < str.length; i++) {
215
+ let c = str[i];
216
+ if (c === "#") {
217
+ i = indexOfNewline(str, i);
218
+ } else if (c === sep) {
219
+ return i + 1;
220
+ } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) {
221
+ return i;
222
+ }
223
+ }
224
+ throw new TomlError("cannot find end of structure", {
225
+ toml: str,
226
+ ptr
227
+ });
228
+ }
229
+ __name(skipUntil, "skipUntil");
230
+ function getStringEnd(str, seek) {
231
+ let first = str[seek];
232
+ let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
233
+ seek += target.length - 1;
234
+ do
235
+ seek = str.indexOf(target, ++seek);
236
+ while (seek > -1 && first !== "'" && isEscaped(str, seek));
237
+ if (seek > -1) {
238
+ seek += target.length;
239
+ if (target.length > 1) {
240
+ if (str[seek] === first)
241
+ seek++;
242
+ if (str[seek] === first)
243
+ seek++;
244
+ }
245
+ }
246
+ return seek;
247
+ }
248
+ __name(getStringEnd, "getStringEnd");
249
+
250
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js
251
+ var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
252
+ var TomlDate = class _TomlDate extends Date {
253
+ static {
254
+ __name(this, "TomlDate");
255
+ }
256
+ #hasDate = false;
257
+ #hasTime = false;
258
+ #offset = null;
259
+ constructor(date) {
260
+ let hasDate = true;
261
+ let hasTime = true;
262
+ let offset = "Z";
263
+ if (typeof date === "string") {
264
+ let match = date.match(DATE_TIME_RE);
265
+ if (match) {
266
+ if (!match[1]) {
267
+ hasDate = false;
268
+ date = `0000-01-01T${date}`;
269
+ }
270
+ hasTime = !!match[2];
271
+ hasTime && date[10] === " " && (date = date.replace(" ", "T"));
272
+ if (match[2] && +match[2] > 23) {
273
+ date = "";
274
+ } else {
275
+ offset = match[3] || null;
276
+ date = date.toUpperCase();
277
+ if (!offset && hasTime)
278
+ date += "Z";
279
+ }
280
+ } else {
281
+ date = "";
282
+ }
283
+ }
284
+ super(date);
285
+ if (!isNaN(this.getTime())) {
286
+ this.#hasDate = hasDate;
287
+ this.#hasTime = hasTime;
288
+ this.#offset = offset;
289
+ }
290
+ }
291
+ isDateTime() {
292
+ return this.#hasDate && this.#hasTime;
293
+ }
294
+ isLocal() {
295
+ return !this.#hasDate || !this.#hasTime || !this.#offset;
296
+ }
297
+ isDate() {
298
+ return this.#hasDate && !this.#hasTime;
299
+ }
300
+ isTime() {
301
+ return this.#hasTime && !this.#hasDate;
302
+ }
303
+ isValid() {
304
+ return this.#hasDate || this.#hasTime;
305
+ }
306
+ toISOString() {
307
+ let iso = super.toISOString();
308
+ if (this.isDate())
309
+ return iso.slice(0, 10);
310
+ if (this.isTime())
311
+ return iso.slice(11, 23);
312
+ if (this.#offset === null)
313
+ return iso.slice(0, -1);
314
+ if (this.#offset === "Z")
315
+ return iso;
316
+ let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
317
+ offset = this.#offset[0] === "-" ? offset : -offset;
318
+ let offsetDate = new Date(this.getTime() - offset * 6e4);
319
+ return offsetDate.toISOString().slice(0, -1) + this.#offset;
320
+ }
321
+ static wrapAsOffsetDateTime(jsDate, offset = "Z") {
322
+ let date = new _TomlDate(jsDate);
323
+ date.#offset = offset;
324
+ return date;
325
+ }
326
+ static wrapAsLocalDateTime(jsDate) {
327
+ let date = new _TomlDate(jsDate);
328
+ date.#offset = null;
329
+ return date;
330
+ }
331
+ static wrapAsLocalDate(jsDate) {
332
+ let date = new _TomlDate(jsDate);
333
+ date.#hasTime = false;
334
+ date.#offset = null;
335
+ return date;
336
+ }
337
+ static wrapAsLocalTime(jsDate) {
338
+ let date = new _TomlDate(jsDate);
339
+ date.#hasDate = false;
340
+ date.#offset = null;
341
+ return date;
342
+ }
343
+ };
344
+
345
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js
346
+ var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
347
+ var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
348
+ var LEADING_ZERO = /^[+-]?0[0-9_]/;
349
+ var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;
350
+ var ESC_MAP = {
351
+ b: "\b",
352
+ t: " ",
353
+ n: "\n",
354
+ f: "\f",
355
+ r: "\r",
356
+ '"': '"',
357
+ "\\": "\\"
358
+ };
359
+ function parseString(str, ptr = 0, endPtr = str.length) {
360
+ let isLiteral = str[ptr] === "'";
361
+ let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
362
+ if (isMultiline) {
363
+ endPtr -= 2;
364
+ if (str[ptr += 2] === "\r")
365
+ ptr++;
366
+ if (str[ptr] === "\n")
367
+ ptr++;
368
+ }
369
+ let tmp = 0;
370
+ let isEscape;
371
+ let parsed = "";
372
+ let sliceStart = ptr;
373
+ while (ptr < endPtr - 1) {
374
+ let c = str[ptr++];
375
+ if (c === "\n" || c === "\r" && str[ptr] === "\n") {
376
+ if (!isMultiline) {
377
+ throw new TomlError("newlines are not allowed in strings", {
378
+ toml: str,
379
+ ptr: ptr - 1
380
+ });
381
+ }
382
+ } else if (c < " " && c !== " " || c === "\x7F") {
383
+ throw new TomlError("control characters are not allowed in strings", {
384
+ toml: str,
385
+ ptr: ptr - 1
386
+ });
387
+ }
388
+ if (isEscape) {
389
+ isEscape = false;
390
+ if (c === "u" || c === "U") {
391
+ let code = str.slice(ptr, ptr += c === "u" ? 4 : 8);
392
+ if (!ESCAPE_REGEX.test(code)) {
393
+ throw new TomlError("invalid unicode escape", {
394
+ toml: str,
395
+ ptr: tmp
396
+ });
397
+ }
398
+ try {
399
+ parsed += String.fromCodePoint(parseInt(code, 16));
400
+ } catch {
401
+ throw new TomlError("invalid unicode escape", {
402
+ toml: str,
403
+ ptr: tmp
404
+ });
405
+ }
406
+ } else if (isMultiline && (c === "\n" || c === " " || c === " " || c === "\r")) {
407
+ ptr = skipVoid(str, ptr - 1, true);
408
+ if (str[ptr] !== "\n" && str[ptr] !== "\r") {
409
+ throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
410
+ toml: str,
411
+ ptr: tmp
412
+ });
413
+ }
414
+ ptr = skipVoid(str, ptr);
415
+ } else if (c in ESC_MAP) {
416
+ parsed += ESC_MAP[c];
417
+ } else {
418
+ throw new TomlError("unrecognized escape sequence", {
419
+ toml: str,
420
+ ptr: tmp
421
+ });
422
+ }
423
+ sliceStart = ptr;
424
+ } else if (!isLiteral && c === "\\") {
425
+ tmp = ptr - 1;
426
+ isEscape = true;
427
+ parsed += str.slice(sliceStart, tmp);
428
+ }
429
+ }
430
+ return parsed + str.slice(sliceStart, endPtr - 1);
431
+ }
432
+ __name(parseString, "parseString");
433
+ function parseValue(value, toml, ptr, integersAsBigInt) {
434
+ if (value === "true")
435
+ return true;
436
+ if (value === "false")
437
+ return false;
438
+ if (value === "-inf")
439
+ return -Infinity;
440
+ if (value === "inf" || value === "+inf")
441
+ return Infinity;
442
+ if (value === "nan" || value === "+nan" || value === "-nan")
443
+ return NaN;
444
+ if (value === "-0")
445
+ return integersAsBigInt ? 0n : 0;
446
+ let isInt = INT_REGEX.test(value);
447
+ if (isInt || FLOAT_REGEX.test(value)) {
448
+ if (LEADING_ZERO.test(value)) {
449
+ throw new TomlError("leading zeroes are not allowed", {
450
+ toml,
451
+ ptr
452
+ });
453
+ }
454
+ value = value.replace(/_/g, "");
455
+ let numeric = +value;
456
+ if (isNaN(numeric)) {
457
+ throw new TomlError("invalid number", {
458
+ toml,
459
+ ptr
460
+ });
461
+ }
462
+ if (isInt) {
463
+ if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
464
+ throw new TomlError("integer value cannot be represented losslessly", {
465
+ toml,
466
+ ptr
467
+ });
468
+ }
469
+ if (isInt || integersAsBigInt === true)
470
+ numeric = BigInt(value);
471
+ }
472
+ return numeric;
473
+ }
474
+ const date = new TomlDate(value);
475
+ if (!date.isValid()) {
476
+ throw new TomlError("invalid value", {
477
+ toml,
478
+ ptr
479
+ });
480
+ }
481
+ return date;
482
+ }
483
+ __name(parseValue, "parseValue");
484
+
485
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js
486
+ function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {
487
+ let value = str.slice(startPtr, endPtr);
488
+ let commentIdx = value.indexOf("#");
489
+ if (commentIdx > -1) {
490
+ skipComment(str, commentIdx);
491
+ value = value.slice(0, commentIdx);
492
+ }
493
+ let trimmed = value.trimEnd();
494
+ if (!allowNewLines) {
495
+ let newlineIdx = value.indexOf("\n", trimmed.length);
496
+ if (newlineIdx > -1) {
497
+ throw new TomlError("newlines are not allowed in inline tables", {
498
+ toml: str,
499
+ ptr: startPtr + newlineIdx
500
+ });
501
+ }
502
+ }
503
+ return [trimmed, commentIdx];
504
+ }
505
+ __name(sliceAndTrimEndOf, "sliceAndTrimEndOf");
506
+ function extractValue(str, ptr, end, depth, integersAsBigInt) {
507
+ if (depth === 0) {
508
+ throw new TomlError("document contains excessively nested structures. aborting.", {
509
+ toml: str,
510
+ ptr
511
+ });
512
+ }
513
+ let c = str[ptr];
514
+ if (c === "[" || c === "{") {
515
+ let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
516
+ let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2;
517
+ if (endPtr2 - newPtr && end === "}") {
518
+ let nextNewLine = indexOfNewline(str, endPtr2, newPtr);
519
+ if (nextNewLine > -1) {
520
+ throw new TomlError("newlines are not allowed in inline tables", {
521
+ toml: str,
522
+ ptr: nextNewLine
523
+ });
524
+ }
525
+ }
526
+ return [value, newPtr];
527
+ }
528
+ let endPtr;
529
+ if (c === '"' || c === "'") {
530
+ endPtr = getStringEnd(str, ptr);
531
+ let parsed = parseString(str, ptr, endPtr);
532
+ if (end) {
533
+ endPtr = skipVoid(str, endPtr, end !== "]");
534
+ if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") {
535
+ throw new TomlError("unexpected character encountered", {
536
+ toml: str,
537
+ ptr: endPtr
538
+ });
539
+ }
540
+ endPtr += +(str[endPtr] === ",");
541
+ }
542
+ return [parsed, endPtr];
543
+ }
544
+ endPtr = skipUntil(str, ptr, ",", end);
545
+ let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]");
546
+ if (!slice[0]) {
547
+ throw new TomlError("incomplete key-value declaration: no value specified", {
548
+ toml: str,
549
+ ptr
550
+ });
551
+ }
552
+ if (end && slice[1] > -1) {
553
+ endPtr = skipVoid(str, ptr + slice[1]);
554
+ endPtr += +(str[endPtr] === ",");
555
+ }
556
+ return [
557
+ parseValue(slice[0], str, ptr, integersAsBigInt),
558
+ endPtr
559
+ ];
560
+ }
561
+ __name(extractValue, "extractValue");
562
+
563
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js
564
+ var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
565
+ function parseKey(str, ptr, end = "=") {
566
+ let dot = ptr - 1;
567
+ let parsed = [];
568
+ let endPtr = str.indexOf(end, ptr);
569
+ if (endPtr < 0) {
570
+ throw new TomlError("incomplete key-value: cannot find end of key", {
571
+ toml: str,
572
+ ptr
573
+ });
574
+ }
575
+ do {
576
+ let c = str[ptr = ++dot];
577
+ if (c !== " " && c !== " ") {
578
+ if (c === '"' || c === "'") {
579
+ if (c === str[ptr + 1] && c === str[ptr + 2]) {
580
+ throw new TomlError("multiline strings are not allowed in keys", {
581
+ toml: str,
582
+ ptr
583
+ });
584
+ }
585
+ let eos = getStringEnd(str, ptr);
586
+ if (eos < 0) {
587
+ throw new TomlError("unfinished string encountered", {
588
+ toml: str,
589
+ ptr
590
+ });
591
+ }
592
+ dot = str.indexOf(".", eos);
593
+ let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
594
+ let newLine = indexOfNewline(strEnd);
595
+ if (newLine > -1) {
596
+ throw new TomlError("newlines are not allowed in keys", {
597
+ toml: str,
598
+ ptr: ptr + dot + newLine
599
+ });
600
+ }
601
+ if (strEnd.trimStart()) {
602
+ throw new TomlError("found extra tokens after the string part", {
603
+ toml: str,
604
+ ptr: eos
605
+ });
606
+ }
607
+ if (endPtr < eos) {
608
+ endPtr = str.indexOf(end, eos);
609
+ if (endPtr < 0) {
610
+ throw new TomlError("incomplete key-value: cannot find end of key", {
611
+ toml: str,
612
+ ptr
613
+ });
614
+ }
615
+ }
616
+ parsed.push(parseString(str, ptr, eos));
617
+ } else {
618
+ dot = str.indexOf(".", ptr);
619
+ let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
620
+ if (!KEY_PART_RE.test(part)) {
621
+ throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
622
+ toml: str,
623
+ ptr
624
+ });
625
+ }
626
+ parsed.push(part.trimEnd());
627
+ }
628
+ }
629
+ } while (dot + 1 && dot < endPtr);
630
+ return [parsed, skipVoid(str, endPtr + 1, true, true)];
631
+ }
632
+ __name(parseKey, "parseKey");
633
+ function parseInlineTable(str, ptr, depth, integersAsBigInt) {
634
+ let res = {};
635
+ let seen = /* @__PURE__ */ new Set();
636
+ let c;
637
+ let comma = 0;
638
+ ptr++;
639
+ while ((c = str[ptr++]) !== "}" && c) {
640
+ let err = { toml: str, ptr: ptr - 1 };
641
+ if (c === "\n") {
642
+ throw new TomlError("newlines are not allowed in inline tables", err);
643
+ } else if (c === "#") {
644
+ throw new TomlError("inline tables cannot contain comments", err);
645
+ } else if (c === ",") {
646
+ throw new TomlError("expected key-value, found comma", err);
647
+ } else if (c !== " " && c !== " ") {
648
+ let k;
649
+ let t = res;
650
+ let hasOwn = false;
651
+ let [key, keyEndPtr] = parseKey(str, ptr - 1);
652
+ for (let i = 0; i < key.length; i++) {
653
+ if (i)
654
+ t = hasOwn ? t[k] : t[k] = {};
655
+ k = key[i];
656
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
657
+ throw new TomlError("trying to redefine an already defined value", {
658
+ toml: str,
659
+ ptr
660
+ });
661
+ }
662
+ if (!hasOwn && k === "__proto__") {
663
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
664
+ }
665
+ }
666
+ if (hasOwn) {
667
+ throw new TomlError("trying to redefine an already defined value", {
668
+ toml: str,
669
+ ptr
670
+ });
671
+ }
672
+ let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
673
+ seen.add(value);
674
+ t[k] = value;
675
+ ptr = valueEndPtr;
676
+ comma = str[ptr - 1] === "," ? ptr - 1 : 0;
677
+ }
678
+ }
679
+ if (comma) {
680
+ throw new TomlError("trailing commas are not allowed in inline tables", {
681
+ toml: str,
682
+ ptr: comma
683
+ });
684
+ }
685
+ if (!c) {
686
+ throw new TomlError("unfinished table encountered", {
687
+ toml: str,
688
+ ptr
689
+ });
690
+ }
691
+ return [res, ptr];
692
+ }
693
+ __name(parseInlineTable, "parseInlineTable");
694
+ function parseArray(str, ptr, depth, integersAsBigInt) {
695
+ let res = [];
696
+ let c;
697
+ ptr++;
698
+ while ((c = str[ptr++]) !== "]" && c) {
699
+ if (c === ",") {
700
+ throw new TomlError("expected value, found comma", {
701
+ toml: str,
702
+ ptr: ptr - 1
703
+ });
704
+ } else if (c === "#")
705
+ ptr = skipComment(str, ptr);
706
+ else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") {
707
+ let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt);
708
+ res.push(e[0]);
709
+ ptr = e[1];
710
+ }
711
+ }
712
+ if (!c) {
713
+ throw new TomlError("unfinished array encountered", {
714
+ toml: str,
715
+ ptr
716
+ });
717
+ }
718
+ return [res, ptr];
719
+ }
720
+ __name(parseArray, "parseArray");
721
+
722
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js
723
+ function peekTable(key, table, meta, type) {
724
+ let t = table;
725
+ let m = meta;
726
+ let k;
727
+ let hasOwn = false;
728
+ let state;
729
+ for (let i = 0; i < key.length; i++) {
730
+ if (i) {
731
+ t = hasOwn ? t[k] : t[k] = {};
732
+ m = (state = m[k]).c;
733
+ if (type === 0 && (state.t === 1 || state.t === 2)) {
734
+ return null;
735
+ }
736
+ if (state.t === 2) {
737
+ let l = t.length - 1;
738
+ t = t[l];
739
+ m = m[l].c;
740
+ }
741
+ }
742
+ k = key[i];
743
+ if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) {
744
+ return null;
745
+ }
746
+ if (!hasOwn) {
747
+ if (k === "__proto__") {
748
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
749
+ Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
750
+ }
751
+ m[k] = {
752
+ t: i < key.length - 1 && type === 2 ? 3 : type,
753
+ d: false,
754
+ i: 0,
755
+ c: {}
756
+ };
757
+ }
758
+ }
759
+ state = m[k];
760
+ if (state.t !== type && !(type === 1 && state.t === 3)) {
761
+ return null;
762
+ }
763
+ if (type === 2) {
764
+ if (!state.d) {
765
+ state.d = true;
766
+ t[k] = [];
767
+ }
768
+ t[k].push(t = {});
769
+ state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };
770
+ }
771
+ if (state.d) {
772
+ return null;
773
+ }
774
+ state.d = true;
775
+ if (type === 1) {
776
+ t = hasOwn ? t[k] : t[k] = {};
777
+ } else if (type === 0 && hasOwn) {
778
+ return null;
779
+ }
780
+ return [k, t, state.c];
781
+ }
782
+ __name(peekTable, "peekTable");
783
+ function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
784
+ let res = {};
785
+ let meta = {};
786
+ let tbl = res;
787
+ let m = meta;
788
+ for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {
789
+ if (toml[ptr] === "[") {
790
+ let isTableArray = toml[++ptr] === "[";
791
+ let k = parseKey(toml, ptr += +isTableArray, "]");
792
+ if (isTableArray) {
793
+ if (toml[k[1] - 1] !== "]") {
794
+ throw new TomlError("expected end of table declaration", {
795
+ toml,
796
+ ptr: k[1] - 1
797
+ });
798
+ }
799
+ k[1]++;
800
+ }
801
+ let p = peekTable(
802
+ k[0],
803
+ res,
804
+ meta,
805
+ isTableArray ? 2 : 1
806
+ /* Type.EXPLICIT */
807
+ );
808
+ if (!p) {
809
+ throw new TomlError("trying to redefine an already defined table or value", {
810
+ toml,
811
+ ptr
812
+ });
813
+ }
814
+ m = p[2];
815
+ tbl = p[1];
816
+ ptr = k[1];
817
+ } else {
818
+ let k = parseKey(toml, ptr);
819
+ let p = peekTable(
820
+ k[0],
821
+ tbl,
822
+ m,
823
+ 0
824
+ /* Type.DOTTED */
825
+ );
826
+ if (!p) {
827
+ throw new TomlError("trying to redefine an already defined table or value", {
828
+ toml,
829
+ ptr
830
+ });
831
+ }
832
+ let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt);
833
+ p[1][p[0]] = v[0];
834
+ ptr = v[1];
835
+ }
836
+ ptr = skipVoid(toml, ptr, true);
837
+ if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
838
+ throw new TomlError("each key-value declaration must be followed by an end-of-line", {
839
+ toml,
840
+ ptr
841
+ });
842
+ }
843
+ ptr = skipVoid(toml, ptr);
844
+ }
845
+ return res;
846
+ }
847
+ __name(parse, "parse");
848
+
849
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js
850
+ var BARE_KEY = /^[a-z0-9-_]+$/i;
851
+ function extendedTypeOf(obj) {
852
+ let type = typeof obj;
853
+ if (type === "object") {
854
+ if (Array.isArray(obj))
855
+ return "array";
856
+ if (obj instanceof Date)
857
+ return "date";
858
+ }
859
+ return type;
860
+ }
861
+ __name(extendedTypeOf, "extendedTypeOf");
862
+ function isArrayOfTables(obj) {
863
+ for (let i = 0; i < obj.length; i++) {
864
+ if (extendedTypeOf(obj[i]) !== "object")
865
+ return false;
866
+ }
867
+ return obj.length != 0;
868
+ }
869
+ __name(isArrayOfTables, "isArrayOfTables");
870
+ function formatString(s) {
871
+ return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
872
+ }
873
+ __name(formatString, "formatString");
874
+ function stringifyValue(val, type, depth, numberAsFloat) {
875
+ if (depth === 0) {
876
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
877
+ }
878
+ if (type === "number") {
879
+ if (isNaN(val))
880
+ return "nan";
881
+ if (val === Infinity)
882
+ return "inf";
883
+ if (val === -Infinity)
884
+ return "-inf";
885
+ if (numberAsFloat && Number.isInteger(val))
886
+ return val.toFixed(1);
887
+ return val.toString();
888
+ }
889
+ if (type === "bigint" || type === "boolean") {
890
+ return val.toString();
891
+ }
892
+ if (type === "string") {
893
+ return formatString(val);
894
+ }
895
+ if (type === "date") {
896
+ if (isNaN(val.getTime())) {
897
+ throw new TypeError("cannot serialize invalid date");
898
+ }
899
+ return val.toISOString();
900
+ }
901
+ if (type === "object") {
902
+ return stringifyInlineTable(val, depth, numberAsFloat);
903
+ }
904
+ if (type === "array") {
905
+ return stringifyArray(val, depth, numberAsFloat);
906
+ }
907
+ }
908
+ __name(stringifyValue, "stringifyValue");
909
+ function stringifyInlineTable(obj, depth, numberAsFloat) {
910
+ let keys = Object.keys(obj);
911
+ if (keys.length === 0)
912
+ return "{}";
913
+ let res = "{ ";
914
+ for (let i = 0; i < keys.length; i++) {
915
+ let k = keys[i];
916
+ if (i)
917
+ res += ", ";
918
+ res += BARE_KEY.test(k) ? k : formatString(k);
919
+ res += " = ";
920
+ res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);
921
+ }
922
+ return res + " }";
923
+ }
924
+ __name(stringifyInlineTable, "stringifyInlineTable");
925
+ function stringifyArray(array, depth, numberAsFloat) {
926
+ if (array.length === 0)
927
+ return "[]";
928
+ let res = "[ ";
929
+ for (let i = 0; i < array.length; i++) {
930
+ if (i)
931
+ res += ", ";
932
+ if (array[i] === null || array[i] === void 0) {
933
+ throw new TypeError("arrays cannot contain null or undefined values");
934
+ }
935
+ res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);
936
+ }
937
+ return res + " ]";
938
+ }
939
+ __name(stringifyArray, "stringifyArray");
940
+ function stringifyArrayTable(array, key, depth, numberAsFloat) {
941
+ if (depth === 0) {
942
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
943
+ }
944
+ let res = "";
945
+ for (let i = 0; i < array.length; i++) {
946
+ res += `${res && "\n"}[[${key}]]
947
+ `;
948
+ res += stringifyTable(0, array[i], key, depth, numberAsFloat);
949
+ }
950
+ return res;
951
+ }
952
+ __name(stringifyArrayTable, "stringifyArrayTable");
953
+ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
954
+ if (depth === 0) {
955
+ throw new Error("Could not stringify the object: maximum object depth exceeded");
956
+ }
957
+ let preamble = "";
958
+ let tables = "";
959
+ let keys = Object.keys(obj);
960
+ for (let i = 0; i < keys.length; i++) {
961
+ let k = keys[i];
962
+ if (obj[k] !== null && obj[k] !== void 0) {
963
+ let type = extendedTypeOf(obj[k]);
964
+ if (type === "symbol" || type === "function") {
965
+ throw new TypeError(`cannot serialize values of type '${type}'`);
966
+ }
967
+ let key = BARE_KEY.test(k) ? k : formatString(k);
968
+ if (type === "array" && isArrayOfTables(obj[k])) {
969
+ tables += (tables && "\n") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
970
+ } else if (type === "object") {
971
+ let tblKey = prefix ? `${prefix}.${key}` : key;
972
+ tables += (tables && "\n") + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);
973
+ } else {
974
+ preamble += key;
975
+ preamble += " = ";
976
+ preamble += stringifyValue(obj[k], type, depth, numberAsFloat);
977
+ preamble += "\n";
978
+ }
979
+ }
980
+ }
981
+ if (tableKey && (preamble || !tables))
982
+ preamble = preamble ? `[${tableKey}]
983
+ ${preamble}` : `[${tableKey}]`;
984
+ return preamble && tables ? `${preamble}
985
+ ${tables}` : preamble || tables;
986
+ }
987
+ __name(stringifyTable, "stringifyTable");
988
+ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
989
+ if (extendedTypeOf(obj) !== "object") {
990
+ throw new TypeError("stringify can only be called with an object");
991
+ }
992
+ let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
993
+ if (str[str.length - 1] !== "\n")
994
+ return str + "\n";
995
+ return str;
996
+ }
997
+ __name(stringify, "stringify");
2239
998
 
2240
- // src/parse.ts
2241
- var import_toml = __toESM(require_toml());
999
+ // ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js
1000
+ var dist_default = { parse, stringify, TomlDate, TomlError };
2242
1001
 
2243
1002
  // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
2244
1003
  function createScanner(text, ignoreTrivia = false) {
@@ -2281,15 +1040,15 @@ function createScanner(text, ignoreTrivia = false) {
2281
1040
  pos++;
2282
1041
  } else {
2283
1042
  pos++;
2284
- while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1043
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
2285
1044
  pos++;
2286
1045
  }
2287
1046
  }
2288
1047
  if (pos < text.length && text.charCodeAt(pos) === 46) {
2289
1048
  pos++;
2290
- if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1049
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
2291
1050
  pos++;
2292
- while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1051
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
2293
1052
  pos++;
2294
1053
  }
2295
1054
  } else {
@@ -2303,9 +1062,9 @@ function createScanner(text, ignoreTrivia = false) {
2303
1062
  if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
2304
1063
  pos++;
2305
1064
  }
2306
- if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1065
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
2307
1066
  pos++;
2308
- while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1067
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
2309
1068
  pos++;
2310
1069
  }
2311
1070
  end = pos;
@@ -2494,7 +1253,7 @@ function createScanner(text, ignoreTrivia = false) {
2494
1253
  case 45:
2495
1254
  value += String.fromCharCode(code);
2496
1255
  pos++;
2497
- if (pos === len || !isDigit2(text.charCodeAt(pos))) {
1256
+ if (pos === len || !isDigit(text.charCodeAt(pos))) {
2498
1257
  return token = 16;
2499
1258
  }
2500
1259
  // found a minus, followed by a number so
@@ -2584,10 +1343,10 @@ function isLineBreak(ch) {
2584
1343
  return ch === 10 || ch === 13;
2585
1344
  }
2586
1345
  __name(isLineBreak, "isLineBreak");
2587
- function isDigit2(ch) {
1346
+ function isDigit(ch) {
2588
1347
  return ch >= 48 && ch <= 57;
2589
1348
  }
2590
- __name(isDigit2, "isDigit");
1349
+ __name(isDigit, "isDigit");
2591
1350
  var CharacterCodes;
2592
1351
  (function(CharacterCodes2) {
2593
1352
  CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
@@ -2913,7 +1672,7 @@ var ParseOptions;
2913
1672
  allowTrailingComma: false
2914
1673
  };
2915
1674
  })(ParseOptions || (ParseOptions = {}));
2916
- function parse(text, errors = [], options = ParseOptions.DEFAULT) {
1675
+ function parse2(text, errors = [], options = ParseOptions.DEFAULT) {
2917
1676
  let currentProperty = null;
2918
1677
  let currentParent = [];
2919
1678
  const previousParents = [];
@@ -2957,7 +1716,7 @@ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
2957
1716
  visit(text, visitor, options);
2958
1717
  return currentParent[0];
2959
1718
  }
2960
- __name(parse, "parse");
1719
+ __name(parse2, "parse");
2961
1720
  function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
2962
1721
  let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
2963
1722
  function ensurePropertyComplete(endOffset) {
@@ -3143,15 +1902,15 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3143
1902
  }
3144
1903
  }
3145
1904
  __name(scanNext, "scanNext");
3146
- function handleError(error, skipUntilAfter = [], skipUntil = []) {
1905
+ function handleError(error, skipUntilAfter = [], skipUntil2 = []) {
3147
1906
  onError(error);
3148
- if (skipUntilAfter.length + skipUntil.length > 0) {
1907
+ if (skipUntilAfter.length + skipUntil2.length > 0) {
3149
1908
  let token = _scanner.getToken();
3150
1909
  while (token !== 17) {
3151
1910
  if (skipUntilAfter.indexOf(token) !== -1) {
3152
1911
  scanNext();
3153
1912
  break;
3154
- } else if (skipUntil.indexOf(token) !== -1) {
1913
+ } else if (skipUntil2.indexOf(token) !== -1) {
3155
1914
  break;
3156
1915
  }
3157
1916
  token = scanNext();
@@ -3159,7 +1918,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3159
1918
  }
3160
1919
  }
3161
1920
  __name(handleError, "handleError");
3162
- function parseString(isValue) {
1921
+ function parseString2(isValue) {
3163
1922
  const value = _scanner.getTokenValue();
3164
1923
  if (isValue) {
3165
1924
  onLiteralValue(value);
@@ -3170,7 +1929,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3170
1929
  scanNext();
3171
1930
  return true;
3172
1931
  }
3173
- __name(parseString, "parseString");
1932
+ __name(parseString2, "parseString");
3174
1933
  function parseLiteral() {
3175
1934
  switch (_scanner.getToken()) {
3176
1935
  case 11:
@@ -3210,11 +1969,11 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3210
1969
  ]);
3211
1970
  return false;
3212
1971
  }
3213
- parseString(false);
1972
+ parseString2(false);
3214
1973
  if (_scanner.getToken() === 6) {
3215
1974
  onSeparator(":");
3216
1975
  scanNext();
3217
- if (!parseValue()) {
1976
+ if (!parseValue2()) {
3218
1977
  handleError(4, [], [
3219
1978
  2,
3220
1979
  5
@@ -3270,7 +2029,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3270
2029
  return true;
3271
2030
  }
3272
2031
  __name(parseObject, "parseObject");
3273
- function parseArray() {
2032
+ function parseArray2() {
3274
2033
  onArrayBegin();
3275
2034
  scanNext();
3276
2035
  let isFirstElement = true;
@@ -3294,7 +2053,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3294
2053
  } else {
3295
2054
  _jsonPath[_jsonPath.length - 1]++;
3296
2055
  }
3297
- if (!parseValue()) {
2056
+ if (!parseValue2()) {
3298
2057
  handleError(4, [], [
3299
2058
  4,
3300
2059
  5
@@ -3317,20 +2076,20 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3317
2076
  }
3318
2077
  return true;
3319
2078
  }
3320
- __name(parseArray, "parseArray");
3321
- function parseValue() {
2079
+ __name(parseArray2, "parseArray");
2080
+ function parseValue2() {
3322
2081
  switch (_scanner.getToken()) {
3323
2082
  case 3:
3324
- return parseArray();
2083
+ return parseArray2();
3325
2084
  case 1:
3326
2085
  return parseObject();
3327
2086
  case 10:
3328
- return parseString(true);
2087
+ return parseString2(true);
3329
2088
  default:
3330
2089
  return parseLiteral();
3331
2090
  }
3332
2091
  }
3333
- __name(parseValue, "parseValue");
2092
+ __name(parseValue2, "parseValue");
3334
2093
  scanNext();
3335
2094
  if (_scanner.getToken() === 17) {
3336
2095
  if (options.allowEmptyContent) {
@@ -3339,7 +2098,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
3339
2098
  handleError(4, [], []);
3340
2099
  return false;
3341
2100
  }
3342
- if (!parseValue()) {
2101
+ if (!parseValue2()) {
3343
2102
  handleError(4, [], []);
3344
2103
  return false;
3345
2104
  }
@@ -3549,7 +2308,7 @@ var SyntaxKind;
3549
2308
  SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
3550
2309
  SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
3551
2310
  })(SyntaxKind || (SyntaxKind = {}));
3552
- var parse2 = parse;
2311
+ var parse3 = parse2;
3553
2312
  var ParseErrorCode;
3554
2313
  (function(ParseErrorCode2) {
3555
2314
  ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
@@ -3637,73 +2396,6 @@ function applyEdits(text, edits) {
3637
2396
  }
3638
2397
  __name(applyEdits, "applyEdits");
3639
2398
 
3640
- // src/errors.ts
3641
- var UserError = class extends Error {
3642
- static {
3643
- __name(this, "UserError");
3644
- }
3645
- telemetryMessage;
3646
- constructor(message, options) {
3647
- super(message, options);
3648
- Object.setPrototypeOf(this, new.target.prototype);
3649
- this.telemetryMessage = options?.telemetryMessage === true ? message : options?.telemetryMessage;
3650
- }
3651
- };
3652
- var DeprecationError = class extends UserError {
3653
- static {
3654
- __name(this, "DeprecationError");
3655
- }
3656
- constructor(message, options) {
3657
- super(`Deprecation:
3658
- ${message}`, options);
3659
- }
3660
- };
3661
- var FatalError = class extends UserError {
3662
- constructor(message, code, options) {
3663
- super(message, options);
3664
- this.code = code;
3665
- }
3666
- static {
3667
- __name(this, "FatalError");
3668
- }
3669
- };
3670
- var CommandLineArgsError = class extends UserError {
3671
- static {
3672
- __name(this, "CommandLineArgsError");
3673
- }
3674
- };
3675
- var JsonFriendlyFatalError = class extends FatalError {
3676
- constructor(message, code, options) {
3677
- super(message, code, options);
3678
- this.code = code;
3679
- }
3680
- static {
3681
- __name(this, "JsonFriendlyFatalError");
3682
- }
3683
- };
3684
- var MissingConfigError = class extends Error {
3685
- static {
3686
- __name(this, "MissingConfigError");
3687
- }
3688
- telemetryMessage;
3689
- constructor(key) {
3690
- super(`Missing config value for ${key}`);
3691
- this.telemetryMessage = `Missing config value for ${key}`;
3692
- }
3693
- };
3694
- function createFatalError(message, isJson, code, telemetryMessage) {
3695
- if (isJson) {
3696
- return new JsonFriendlyFatalError(
3697
- JSON.stringify(message),
3698
- code,
3699
- telemetryMessage
3700
- );
3701
- } else {
3702
- return new FatalError(`${message}`, code, telemetryMessage);
3703
- }
3704
- }
3705
- __name(createFatalError, "createFatalError");
3706
-
3707
2399
  // src/parse.ts
3708
2400
  var ParseError = class extends UserError {
3709
2401
  static {
@@ -3752,28 +2444,22 @@ var APIError = class extends ParseError {
3752
2444
  this.#reportable = false;
3753
2445
  }
3754
2446
  };
3755
- var TOML_ERROR_NAME = "TomlError";
3756
- var TOML_ERROR_SUFFIX = " at row ";
3757
2447
  function parseTOML(input, file) {
3758
2448
  try {
3759
- const normalizedInput = input.replace(/\r\n/g, "\n");
3760
- return import_toml.default.parse(normalizedInput);
2449
+ return dist_default.parse(input);
3761
2450
  } catch (err) {
3762
- const { name, message, line, col } = err;
3763
- if (name !== TOML_ERROR_NAME) {
2451
+ if (!(err instanceof TomlError)) {
3764
2452
  throw err;
3765
2453
  }
3766
- const text = message.substring(0, message.lastIndexOf(TOML_ERROR_SUFFIX));
3767
- const lineText = input.split("\n")[line];
3768
2454
  const location = {
3769
- lineText,
3770
- line: line + 1,
3771
- column: col - 1,
2455
+ lineText: input.split("\n")[err.line - 1],
2456
+ line: err.line,
2457
+ column: err.column - 1,
3772
2458
  file,
3773
2459
  fileText: input
3774
2460
  };
3775
2461
  throw new ParseError({
3776
- text,
2462
+ text: err.message.substring(0, err.message.indexOf("\n")),
3777
2463
  location,
3778
2464
  telemetryMessage: "TOML parse error"
3779
2465
  });
@@ -3794,7 +2480,7 @@ function parseJSON(input, file) {
3794
2480
  __name(parseJSON, "parseJSON");
3795
2481
  function parseJSONC(input, file, options = { allowTrailingComma: true }) {
3796
2482
  const errors = [];
3797
- const data = parse2(input, errors, options);
2483
+ const data = parse3(input, errors, options);
3798
2484
  if (errors.length) {
3799
2485
  throw new ParseError({
3800
2486
  text: printParseErrorCode(errors[0].error),
@@ -4139,12 +2825,6 @@ function dedent(templ) {
4139
2825
  __name(dedent, "dedent");
4140
2826
  var esm_default = dedent;
4141
2827
 
4142
- // src/constants.ts
4143
- var INHERIT_SYMBOL = Symbol.for("inherit_binding");
4144
- var SERVICE_TAG_PREFIX = "cf:service=";
4145
- var ENVIRONMENT_TAG_PREFIX = "cf:environment=";
4146
- var PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json";
4147
-
4148
2828
  // src/config/config-helpers.ts
4149
2829
  function resolveWranglerConfigPath({
4150
2830
  config,
@@ -4258,7 +2938,7 @@ __name(configFileName, "configFileName");
4258
2938
  function formatConfigSnippet(snippet, configPath, formatted = true) {
4259
2939
  const format3 = configFormat(configPath);
4260
2940
  if (format3 === "toml") {
4261
- return import_toml2.default.stringify(snippet);
2941
+ return dist_default.stringify(snippet);
4262
2942
  } else {
4263
2943
  return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
4264
2944
  }
@@ -4284,9 +2964,6 @@ var experimental_readRawConfig = /* @__PURE__ */ __name((args, options = {}) =>
4284
2964
  redirected
4285
2965
  };
4286
2966
  }, "experimental_readRawConfig");
4287
-
4288
- // src/config/patch-config.ts
4289
- var import_toml3 = __toESM(require_toml());
4290
2967
  var experimental_patchConfig = /* @__PURE__ */ __name((configPath, patch, isArrayInsertion = true) => {
4291
2968
  let configString = readFileSync(configPath);
4292
2969
  if (configPath.endsWith("toml")) {
@@ -4310,7 +2987,7 @@ var experimental_patchConfig = /* @__PURE__ */ __name((configPath, patch, isArra
4310
2987
  const formatEdit = format2(configString, void 0, {});
4311
2988
  configString = applyEdits(configString, formatEdit);
4312
2989
  if (configPath.endsWith(".toml")) {
4313
- configString = import_toml3.default.stringify(parseJSONC(configString));
2990
+ configString = dist_default.stringify(parseJSONC(configString));
4314
2991
  }
4315
2992
  writeFileSync(configPath, configString);
4316
2993
  return configString;
@@ -4322,13 +2999,13 @@ var getJSONPath = /* @__PURE__ */ __name((obj, allPaths, isArrayInsertion, prevP
4322
2999
  v.forEach((x, i) => {
4323
3000
  if (isArrayInsertion) {
4324
3001
  allPaths.push([...currentPath, -1, x]);
4325
- } else if (typeof x === "object") {
3002
+ } else if (typeof x === "object" && x !== null) {
4326
3003
  getJSONPath(x, allPaths, isArrayInsertion, [...currentPath, i]);
4327
3004
  } else {
4328
3005
  allPaths.push([...currentPath, i, x]);
4329
3006
  }
4330
3007
  });
4331
- } else if (typeof v === "object") {
3008
+ } else if (typeof v === "object" && v !== null) {
4332
3009
  getJSONPath(v, allPaths, isArrayInsertion, currentPath);
4333
3010
  } else {
4334
3011
  allPaths.push([...currentPath, v]);
@@ -4923,9 +3600,9 @@ var validateOptionalTypedArray = /* @__PURE__ */ __name((diagnostics, container,
4923
3600
  }
4924
3601
  return true;
4925
3602
  }, "validateOptionalTypedArray");
4926
- var isRequiredProperty = /* @__PURE__ */ __name((obj, prop, type, choices) => hasProperty(obj, prop) && typeof obj[prop] === type && (choices === void 0 || choices.includes(obj[prop])), "isRequiredProperty");
4927
- var isOptionalProperty = /* @__PURE__ */ __name((obj, prop, type) => !hasProperty(obj, prop) || typeof obj[prop] === type, "isOptionalProperty");
4928
- var hasProperty = /* @__PURE__ */ __name((obj, property) => property in obj, "hasProperty");
3603
+ var isRequiredProperty = /* @__PURE__ */ __name((target, property, type, choices) => hasProperty(target, property) && typeof target[property] === type && (choices === void 0 || choices.includes(target[property])), "isRequiredProperty");
3604
+ var isOptionalProperty = /* @__PURE__ */ __name((target, property, type) => !hasProperty(target, property) || typeof target[property] === type, "isOptionalProperty");
3605
+ var hasProperty = /* @__PURE__ */ __name((target, property) => property in target, "hasProperty");
4929
3606
  var validateAdditionalProperties = /* @__PURE__ */ __name((diagnostics, fieldPath, restProps, knownProps) => {
4930
3607
  const restPropSet = new Set(restProps);
4931
3608
  for (const knownProp of knownProps) {
@@ -5706,6 +4383,38 @@ var validateTailConsumers = /* @__PURE__ */ __name((diagnostics, field, value) =
5706
4383
  }
5707
4384
  return isValid;
5708
4385
  }, "validateTailConsumers");
4386
+ function validateStreamingTailConsumer(diagnostics, field, value) {
4387
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
4388
+ diagnostics.errors.push(
4389
+ `"${field}" should be an object but got ${JSON.stringify(value)}.`
4390
+ );
4391
+ return false;
4392
+ }
4393
+ return validateRequiredProperty(
4394
+ diagnostics,
4395
+ field,
4396
+ "service",
4397
+ value.service,
4398
+ "string"
4399
+ );
4400
+ }
4401
+ __name(validateStreamingTailConsumer, "validateStreamingTailConsumer");
4402
+ var validateStreamingTailConsumers = /* @__PURE__ */ __name((diagnostics, field, value) => {
4403
+ if (!value) {
4404
+ return true;
4405
+ }
4406
+ if (!Array.isArray(value)) {
4407
+ diagnostics.errors.push(
4408
+ `Expected "${field}" to be an array but got ${JSON.stringify(value)}.`
4409
+ );
4410
+ return false;
4411
+ }
4412
+ let isValid = true;
4413
+ for (let i = 0; i < value.length; i++) {
4414
+ isValid = validateStreamingTailConsumer(diagnostics, `${field}[${i}]`, value[i]) && isValid;
4415
+ }
4416
+ return isValid;
4417
+ }, "validateStreamingTailConsumers");
5709
4418
  function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, preserveOriginalMain, envName = "top level", topLevelEnv, useServiceEnvironments, rawConfig) {
5710
4419
  deprecated(
5711
4420
  diagnostics,
@@ -6059,6 +4768,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
6059
4768
  validateTailConsumers,
6060
4769
  void 0
6061
4770
  ),
4771
+ streaming_tail_consumers: notInheritable(
4772
+ diagnostics,
4773
+ topLevelEnv,
4774
+ rawConfig,
4775
+ rawEnv,
4776
+ envName,
4777
+ "streaming_tail_consumers",
4778
+ validateStreamingTailConsumers,
4779
+ void 0
4780
+ ),
6062
4781
  unsafe: notInheritable(
6063
4782
  diagnostics,
6064
4783
  topLevelEnv,
@@ -8640,448 +7359,268 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
8640
7359
  }
8641
7360
  }
8642
7361
  __name(validateDurableObjectBinding2, "validateDurableObjectBinding");
7362
+ /*! Bundled license information:
8643
7363
 
8644
- // src/assert-never.ts
8645
- function assertNever(_value) {
8646
- }
8647
- __name(assertNever, "assertNever");
7364
+ smol-toml/dist/error.js:
7365
+ (*!
7366
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7367
+ * SPDX-License-Identifier: BSD-3-Clause
7368
+ *
7369
+ * Redistribution and use in source and binary forms, with or without
7370
+ * modification, are permitted provided that the following conditions are met:
7371
+ *
7372
+ * 1. Redistributions of source code must retain the above copyright notice, this
7373
+ * list of conditions and the following disclaimer.
7374
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7375
+ * this list of conditions and the following disclaimer in the
7376
+ * documentation and/or other materials provided with the distribution.
7377
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7378
+ * may be used to endorse or promote products derived from this software without
7379
+ * specific prior written permission.
7380
+ *
7381
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7382
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7383
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7384
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7385
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7386
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7387
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7388
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7389
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7390
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7391
+ *)
8648
7392
 
8649
- // src/format-compatibility-date.ts
8650
- function formatCompatibilityDate(date) {
8651
- return date.toISOString().slice(0, 10);
8652
- }
8653
- __name(formatCompatibilityDate, "formatCompatibilityDate");
7393
+ smol-toml/dist/util.js:
7394
+ (*!
7395
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7396
+ * SPDX-License-Identifier: BSD-3-Clause
7397
+ *
7398
+ * Redistribution and use in source and binary forms, with or without
7399
+ * modification, are permitted provided that the following conditions are met:
7400
+ *
7401
+ * 1. Redistributions of source code must retain the above copyright notice, this
7402
+ * list of conditions and the following disclaimer.
7403
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7404
+ * this list of conditions and the following disclaimer in the
7405
+ * documentation and/or other materials provided with the distribution.
7406
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7407
+ * may be used to endorse or promote products derived from this software without
7408
+ * specific prior written permission.
7409
+ *
7410
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7411
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7412
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7413
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7414
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7415
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7416
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7417
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7418
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7419
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7420
+ *)
8654
7421
 
8655
- // src/map-worker-metadata-bindings.ts
8656
- function mapWorkerMetadataBindings(bindings) {
8657
- return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
8658
- switch (binding.type) {
8659
- case "plain_text":
8660
- {
8661
- configObj.vars = {
8662
- ...configObj.vars ?? {},
8663
- [binding.name]: binding.text
8664
- };
8665
- }
8666
- break;
8667
- case "json":
8668
- {
8669
- configObj.vars = {
8670
- ...configObj.vars ?? {},
8671
- name: binding.name,
8672
- json: binding.json
8673
- };
8674
- }
8675
- break;
8676
- case "kv_namespace":
8677
- {
8678
- configObj.kv_namespaces = [
8679
- ...configObj.kv_namespaces ?? [],
8680
- { id: binding.namespace_id, binding: binding.name }
8681
- ];
8682
- }
8683
- break;
8684
- case "durable_object_namespace":
8685
- {
8686
- configObj.durable_objects = {
8687
- bindings: [
8688
- ...configObj.durable_objects?.bindings ?? [],
8689
- {
8690
- name: binding.name,
8691
- class_name: binding.class_name,
8692
- script_name: binding.script_name,
8693
- environment: binding.environment
8694
- }
8695
- ]
8696
- };
8697
- }
8698
- break;
8699
- case "d1":
8700
- {
8701
- configObj.d1_databases = [
8702
- ...configObj.d1_databases ?? [],
8703
- {
8704
- binding: binding.name,
8705
- database_id: binding.id
8706
- }
8707
- ];
8708
- }
8709
- break;
8710
- case "browser":
8711
- {
8712
- configObj.browser = {
8713
- binding: binding.name
8714
- };
8715
- }
8716
- break;
8717
- case "ai":
8718
- {
8719
- configObj.ai = {
8720
- binding: binding.name
8721
- };
8722
- }
8723
- break;
8724
- case "images":
8725
- {
8726
- configObj.images = {
8727
- binding: binding.name
8728
- };
8729
- }
8730
- break;
8731
- case "media":
8732
- {
8733
- configObj.media = {
8734
- binding: binding.name
8735
- };
8736
- }
8737
- break;
8738
- case "r2_bucket":
8739
- {
8740
- configObj.r2_buckets = [
8741
- ...configObj.r2_buckets ?? [],
8742
- {
8743
- binding: binding.name,
8744
- bucket_name: binding.bucket_name,
8745
- jurisdiction: binding.jurisdiction
8746
- }
8747
- ];
8748
- }
8749
- break;
8750
- case "secrets_store_secret":
8751
- {
8752
- configObj.secrets_store_secrets = [
8753
- ...configObj.secrets_store_secrets ?? [],
8754
- {
8755
- binding: binding.name,
8756
- store_id: binding.store_id,
8757
- secret_name: binding.secret_name
8758
- }
8759
- ];
8760
- }
8761
- break;
8762
- case "unsafe_hello_world": {
8763
- configObj.unsafe_hello_world = [
8764
- ...configObj.unsafe_hello_world ?? [],
8765
- {
8766
- binding: binding.name,
8767
- enable_timer: binding.enable_timer
8768
- }
8769
- ];
8770
- break;
8771
- }
8772
- case "service":
8773
- {
8774
- configObj.services = [
8775
- ...configObj.services ?? [],
8776
- {
8777
- binding: binding.name,
8778
- service: binding.service,
8779
- environment: binding.environment,
8780
- entrypoint: binding.entrypoint
8781
- }
8782
- ];
8783
- }
8784
- break;
8785
- case "analytics_engine":
8786
- {
8787
- configObj.analytics_engine_datasets = [
8788
- ...configObj.analytics_engine_datasets ?? [],
8789
- { binding: binding.name, dataset: binding.dataset }
8790
- ];
8791
- }
8792
- break;
8793
- case "dispatch_namespace":
8794
- {
8795
- configObj.dispatch_namespaces = [
8796
- ...configObj.dispatch_namespaces ?? [],
8797
- {
8798
- binding: binding.name,
8799
- namespace: binding.namespace,
8800
- ...binding.outbound && {
8801
- outbound: {
8802
- service: binding.outbound.worker.service,
8803
- environment: binding.outbound.worker.environment,
8804
- parameters: binding.outbound.params?.map((p) => p.name) ?? []
8805
- }
8806
- }
8807
- }
8808
- ];
8809
- }
8810
- break;
8811
- case "logfwdr":
8812
- {
8813
- configObj.logfwdr = {
8814
- bindings: [
8815
- ...configObj.logfwdr?.bindings ?? [],
8816
- { name: binding.name, destination: binding.destination }
8817
- ]
8818
- };
8819
- }
8820
- break;
8821
- case "wasm_module":
8822
- {
8823
- configObj.wasm_modules = {
8824
- ...configObj.wasm_modules ?? {},
8825
- [binding.name]: binding.part
8826
- };
8827
- }
8828
- break;
8829
- case "text_blob":
8830
- {
8831
- configObj.text_blobs = {
8832
- ...configObj.text_blobs ?? {},
8833
- [binding.name]: binding.part
8834
- };
8835
- }
8836
- break;
8837
- case "data_blob":
8838
- {
8839
- configObj.data_blobs = {
8840
- ...configObj.data_blobs ?? {},
8841
- [binding.name]: binding.part
8842
- };
8843
- }
8844
- break;
8845
- case "secret_text":
8846
- break;
8847
- case "version_metadata": {
8848
- {
8849
- configObj.version_metadata = {
8850
- binding: binding.name
8851
- };
8852
- }
8853
- break;
8854
- }
8855
- case "send_email": {
8856
- configObj.send_email = [
8857
- ...configObj.send_email ?? [],
8858
- {
8859
- name: binding.name,
8860
- destination_address: binding.destination_address,
8861
- allowed_destination_addresses: binding.allowed_destination_addresses,
8862
- allowed_sender_addresses: binding.allowed_sender_addresses
8863
- }
8864
- ];
8865
- break;
8866
- }
8867
- case "queue":
8868
- configObj.queues ??= { producers: [] };
8869
- configObj.queues.producers = [
8870
- ...configObj.queues.producers ?? [],
8871
- {
8872
- binding: binding.name,
8873
- queue: binding.queue_name,
8874
- delivery_delay: binding.delivery_delay
8875
- }
8876
- ];
8877
- break;
8878
- case "vectorize":
8879
- configObj.vectorize = [
8880
- ...configObj.vectorize ?? [],
8881
- {
8882
- binding: binding.name,
8883
- index_name: binding.index_name
8884
- }
8885
- ];
8886
- break;
8887
- case "hyperdrive":
8888
- configObj.hyperdrive = [
8889
- ...configObj.hyperdrive ?? [],
8890
- {
8891
- binding: binding.name,
8892
- id: binding.id
8893
- }
8894
- ];
8895
- break;
8896
- case "mtls_certificate":
8897
- configObj.mtls_certificates = [
8898
- ...configObj.mtls_certificates ?? [],
8899
- {
8900
- binding: binding.name,
8901
- certificate_id: binding.certificate_id
8902
- }
8903
- ];
8904
- break;
8905
- case "pipelines":
8906
- configObj.pipelines = [
8907
- ...configObj.pipelines ?? [],
8908
- {
8909
- binding: binding.name,
8910
- pipeline: binding.pipeline
8911
- }
8912
- ];
8913
- break;
8914
- case "assets":
8915
- throw new FatalError(
8916
- "`wrangler init --from-dash` is not yet supported for Workers with Assets"
8917
- );
8918
- case "inherit":
8919
- configObj.unsafe = {
8920
- bindings: [...configObj.unsafe?.bindings ?? [], binding],
8921
- metadata: configObj.unsafe?.metadata ?? void 0
8922
- };
8923
- break;
8924
- case "workflow":
8925
- {
8926
- configObj.workflows = [
8927
- ...configObj.workflows ?? [],
8928
- {
8929
- binding: binding.name,
8930
- name: binding.workflow_name,
8931
- class_name: binding.class_name,
8932
- script_name: binding.script_name
8933
- }
8934
- ];
8935
- }
8936
- break;
8937
- case "worker_loader":
8938
- {
8939
- configObj.worker_loaders = [
8940
- ...configObj.worker_loaders ?? [],
8941
- {
8942
- binding: binding.name
8943
- }
8944
- ];
8945
- }
8946
- break;
8947
- case "ratelimit":
8948
- {
8949
- configObj.ratelimits = [
8950
- ...configObj.ratelimits ?? [],
8951
- {
8952
- name: binding.name,
8953
- namespace_id: binding.namespace_id,
8954
- simple: {
8955
- limit: binding.simple.limit,
8956
- period: binding.simple.period
8957
- }
8958
- }
8959
- ];
8960
- }
8961
- break;
8962
- case "vpc_service":
8963
- {
8964
- configObj.vpc_services = [
8965
- ...configObj.vpc_services ?? [],
8966
- {
8967
- binding: binding.name,
8968
- service_id: binding.service_id
8969
- }
8970
- ];
8971
- }
8972
- break;
8973
- default: {
8974
- configObj.unsafe = {
8975
- bindings: [...configObj.unsafe?.bindings ?? [], binding],
8976
- metadata: configObj.unsafe?.metadata ?? void 0
8977
- };
8978
- }
8979
- }
8980
- return configObj;
8981
- }, {});
8982
- }
8983
- __name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
7422
+ smol-toml/dist/date.js:
7423
+ (*!
7424
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7425
+ * SPDX-License-Identifier: BSD-3-Clause
7426
+ *
7427
+ * Redistribution and use in source and binary forms, with or without
7428
+ * modification, are permitted provided that the following conditions are met:
7429
+ *
7430
+ * 1. Redistributions of source code must retain the above copyright notice, this
7431
+ * list of conditions and the following disclaimer.
7432
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7433
+ * this list of conditions and the following disclaimer in the
7434
+ * documentation and/or other materials provided with the distribution.
7435
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7436
+ * may be used to endorse or promote products derived from this software without
7437
+ * specific prior written permission.
7438
+ *
7439
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7440
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7441
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7442
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7443
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7444
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7445
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7446
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7447
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7448
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7449
+ *)
8984
7450
 
8985
- // src/construct-wrangler-config.ts
8986
- function convertWorkerToWranglerConfig(workerName, entrypoint, {
8987
- bindings,
8988
- routes,
8989
- customDomains,
8990
- subdomainStatus,
8991
- serviceEnvMetadata,
8992
- cronTriggers
8993
- }) {
8994
- const mappedBindings = mapWorkerMetadataBindings(bindings);
8995
- const durableObjectClassNames = bindings.filter((binding) => binding.type === "durable_object_namespace").map(
8996
- (durableObject) => durableObject.class_name
8997
- );
8998
- const allRoutes = [
8999
- ...routes.map((r) => ({
9000
- pattern: r.pattern,
9001
- zone_name: r.zone_name
9002
- })),
9003
- ...customDomains.map((c) => ({
9004
- pattern: c.hostname,
9005
- zone_name: c.zone_name,
9006
- custom_domain: true
9007
- }))
9008
- ];
9009
- return {
9010
- name: workerName,
9011
- main: entrypoint,
9012
- workers_dev: subdomainStatus.enabled,
9013
- preview_urls: subdomainStatus.previews_enabled,
9014
- compatibility_date: serviceEnvMetadata.script.compatibility_date ?? formatCompatibilityDate(/* @__PURE__ */ new Date()),
9015
- compatibility_flags: serviceEnvMetadata.script.compatibility_flags,
9016
- ...allRoutes.length ? { routes: allRoutes } : {},
9017
- placement: serviceEnvMetadata.script.placement_mode === "smart" ? { mode: "smart" } : void 0,
9018
- limits: serviceEnvMetadata.script.limits,
9019
- ...durableObjectClassNames.length ? {
9020
- migrations: [
9021
- {
9022
- tag: serviceEnvMetadata.script.migration_tag,
9023
- new_classes: durableObjectClassNames
9024
- }
9025
- ]
9026
- } : {},
9027
- ...cronTriggers.schedules.length ? {
9028
- triggers: {
9029
- crons: cronTriggers.schedules.map((scheduled) => scheduled.cron)
9030
- }
9031
- } : {},
9032
- tail_consumers: serviceEnvMetadata.script.tail_consumers ?? void 0,
9033
- observability: serviceEnvMetadata.script.observability,
9034
- ...mappedBindings
9035
- };
9036
- }
9037
- __name(convertWorkerToWranglerConfig, "convertWorkerToWranglerConfig");
9038
- function constructWranglerConfig(workerName, entrypoint, workerOrWorkers) {
9039
- let workers;
9040
- if (Array.isArray(workerOrWorkers)) {
9041
- workers = workerOrWorkers;
9042
- } else {
9043
- workers = [workerOrWorkers];
9044
- }
9045
- const topLevelEnv = workers.find(
9046
- (w) => !w.serviceEnvMetadata.script.tags?.some(
9047
- (t) => t.startsWith(ENVIRONMENT_TAG_PREFIX)
9048
- )
9049
- );
9050
- let combinedConfig;
9051
- if (topLevelEnv) {
9052
- combinedConfig = convertWorkerToWranglerConfig(
9053
- workerName,
9054
- entrypoint,
9055
- topLevelEnv
9056
- );
9057
- } else {
9058
- combinedConfig = {
9059
- name: workerName,
9060
- main: entrypoint
9061
- };
9062
- }
9063
- for (const env of workers) {
9064
- const serviceTag = env.serviceEnvMetadata.script.tags?.find(
9065
- (t) => t === `${SERVICE_TAG_PREFIX}${workerName}`
9066
- );
9067
- const envTag = env.serviceEnvMetadata.script.tags?.find(
9068
- (t) => t.startsWith(ENVIRONMENT_TAG_PREFIX)
9069
- );
9070
- if (serviceTag !== workerName || envTag === void 0) {
9071
- continue;
9072
- }
9073
- const [_, envName] = envTag.split("=");
9074
- combinedConfig.env ??= {};
9075
- combinedConfig.env[envName] = convertWorkerToWranglerConfig(
9076
- workerName,
9077
- entrypoint,
9078
- env
9079
- );
9080
- }
9081
- return combinedConfig;
9082
- }
9083
- __name(constructWranglerConfig, "constructWranglerConfig");
7451
+ smol-toml/dist/primitive.js:
7452
+ (*!
7453
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7454
+ * SPDX-License-Identifier: BSD-3-Clause
7455
+ *
7456
+ * Redistribution and use in source and binary forms, with or without
7457
+ * modification, are permitted provided that the following conditions are met:
7458
+ *
7459
+ * 1. Redistributions of source code must retain the above copyright notice, this
7460
+ * list of conditions and the following disclaimer.
7461
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7462
+ * this list of conditions and the following disclaimer in the
7463
+ * documentation and/or other materials provided with the distribution.
7464
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7465
+ * may be used to endorse or promote products derived from this software without
7466
+ * specific prior written permission.
7467
+ *
7468
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7469
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7470
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7471
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7472
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7473
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7474
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7475
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7476
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7477
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7478
+ *)
7479
+
7480
+ smol-toml/dist/extract.js:
7481
+ (*!
7482
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7483
+ * SPDX-License-Identifier: BSD-3-Clause
7484
+ *
7485
+ * Redistribution and use in source and binary forms, with or without
7486
+ * modification, are permitted provided that the following conditions are met:
7487
+ *
7488
+ * 1. Redistributions of source code must retain the above copyright notice, this
7489
+ * list of conditions and the following disclaimer.
7490
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7491
+ * this list of conditions and the following disclaimer in the
7492
+ * documentation and/or other materials provided with the distribution.
7493
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7494
+ * may be used to endorse or promote products derived from this software without
7495
+ * specific prior written permission.
7496
+ *
7497
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7498
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7499
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7500
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7501
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7502
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7503
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7504
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7505
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7506
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7507
+ *)
7508
+
7509
+ smol-toml/dist/struct.js:
7510
+ (*!
7511
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7512
+ * SPDX-License-Identifier: BSD-3-Clause
7513
+ *
7514
+ * Redistribution and use in source and binary forms, with or without
7515
+ * modification, are permitted provided that the following conditions are met:
7516
+ *
7517
+ * 1. Redistributions of source code must retain the above copyright notice, this
7518
+ * list of conditions and the following disclaimer.
7519
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7520
+ * this list of conditions and the following disclaimer in the
7521
+ * documentation and/or other materials provided with the distribution.
7522
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7523
+ * may be used to endorse or promote products derived from this software without
7524
+ * specific prior written permission.
7525
+ *
7526
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7527
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7528
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7529
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7530
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7531
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7532
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7533
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7534
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7535
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7536
+ *)
7537
+
7538
+ smol-toml/dist/parse.js:
7539
+ (*!
7540
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7541
+ * SPDX-License-Identifier: BSD-3-Clause
7542
+ *
7543
+ * Redistribution and use in source and binary forms, with or without
7544
+ * modification, are permitted provided that the following conditions are met:
7545
+ *
7546
+ * 1. Redistributions of source code must retain the above copyright notice, this
7547
+ * list of conditions and the following disclaimer.
7548
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7549
+ * this list of conditions and the following disclaimer in the
7550
+ * documentation and/or other materials provided with the distribution.
7551
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7552
+ * may be used to endorse or promote products derived from this software without
7553
+ * specific prior written permission.
7554
+ *
7555
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7556
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7557
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7558
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7559
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7560
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7561
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7562
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7563
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7564
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7565
+ *)
7566
+
7567
+ smol-toml/dist/stringify.js:
7568
+ (*!
7569
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7570
+ * SPDX-License-Identifier: BSD-3-Clause
7571
+ *
7572
+ * Redistribution and use in source and binary forms, with or without
7573
+ * modification, are permitted provided that the following conditions are met:
7574
+ *
7575
+ * 1. Redistributions of source code must retain the above copyright notice, this
7576
+ * list of conditions and the following disclaimer.
7577
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7578
+ * this list of conditions and the following disclaimer in the
7579
+ * documentation and/or other materials provided with the distribution.
7580
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7581
+ * may be used to endorse or promote products derived from this software without
7582
+ * specific prior written permission.
7583
+ *
7584
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7585
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7586
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7587
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7588
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7589
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7590
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7591
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7592
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7593
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7594
+ *)
7595
+
7596
+ smol-toml/dist/index.js:
7597
+ (*!
7598
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7599
+ * SPDX-License-Identifier: BSD-3-Clause
7600
+ *
7601
+ * Redistribution and use in source and binary forms, with or without
7602
+ * modification, are permitted provided that the following conditions are met:
7603
+ *
7604
+ * 1. Redistributions of source code must retain the above copyright notice, this
7605
+ * list of conditions and the following disclaimer.
7606
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7607
+ * this list of conditions and the following disclaimer in the
7608
+ * documentation and/or other materials provided with the distribution.
7609
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7610
+ * may be used to endorse or promote products derived from this software without
7611
+ * specific prior written permission.
7612
+ *
7613
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7614
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7615
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7616
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7617
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7618
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7619
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7620
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7621
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7622
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7623
+ *)
7624
+ */
9084
7625
 
9085
- export { APIError, CommandLineArgsError, DeprecationError, ENVIRONMENT_TAG_PREFIX, FatalError, INHERIT_SYMBOL, JsonFriendlyFatalError, MissingConfigError, PATH_TO_DEPLOY_CONFIG, ParseError, PatchConfigError, SERVICE_TAG_PREFIX, UserError, assertNever, bucketFormatMessage, configFileName, configFormat, constructWranglerConfig, createFatalError, defaultWranglerConfig, experimental_patchConfig, experimental_readRawConfig, findWranglerConfig, formatCompatibilityDate, formatConfigSnippet, friendlyBindingNames, indexLocation, isPagesConfig, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation, validatePagesConfig };
9086
- //# sourceMappingURL=index.mjs.map
9087
- //# sourceMappingURL=index.mjs.map
7626
+ export { APIError, ParseError, PatchConfigError, bucketFormatMessage, configFileName, configFormat, defaultWranglerConfig, experimental_patchConfig, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, friendlyBindingNames, hasProperty, indexLocation, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation, validatePagesConfig };