@cloudflare/vitest-plugin 1.2.2 → 1.2.3
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/pool/index.mjs +728 -845
- package/dist/pool/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/pool/index.mjs
CHANGED
|
@@ -324,7 +324,7 @@ function createFatalError$1(message, isJson, options) {
|
|
|
324
324
|
__name$3(createFatalError$1, "createFatalError");
|
|
325
325
|
|
|
326
326
|
//#endregion
|
|
327
|
-
//#region ../workers-utils/dist/chunk-
|
|
327
|
+
//#region ../workers-utils/dist/chunk-IKXB77SR.mjs
|
|
328
328
|
function hasKnownExportType(entry) {
|
|
329
329
|
const type = entry?.type;
|
|
330
330
|
return type === "durable-object" || type === "worker";
|
|
@@ -1628,114 +1628,7 @@ function applyEdits(text, edits) {
|
|
|
1628
1628
|
return text;
|
|
1629
1629
|
}
|
|
1630
1630
|
__name$3(applyEdits, "applyEdits");
|
|
1631
|
-
|
|
1632
|
-
let lines = string$1.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
1633
|
-
return [lines.length, lines.pop().length + 1];
|
|
1634
|
-
}
|
|
1635
|
-
__name$3(getLineColFromPtr$1, "getLineColFromPtr");
|
|
1636
|
-
function makeCodeBlock$1(string$1, line, column) {
|
|
1637
|
-
let lines = string$1.split(/\r\n|\n|\r/g);
|
|
1638
|
-
let codeblock = "";
|
|
1639
|
-
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
1640
|
-
for (let i = line - 1; i <= line + 1; i++) {
|
|
1641
|
-
let l = lines[i - 1];
|
|
1642
|
-
if (!l) continue;
|
|
1643
|
-
codeblock += i.toString().padEnd(numberLen, " ");
|
|
1644
|
-
codeblock += ": ";
|
|
1645
|
-
codeblock += l;
|
|
1646
|
-
codeblock += "\n";
|
|
1647
|
-
if (i === line) {
|
|
1648
|
-
codeblock += " ".repeat(numberLen + column + 2);
|
|
1649
|
-
codeblock += "^\n";
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
return codeblock;
|
|
1653
|
-
}
|
|
1654
|
-
__name$3(makeCodeBlock$1, "makeCodeBlock");
|
|
1655
|
-
var TomlError$1 = class extends Error {
|
|
1656
|
-
static {
|
|
1657
|
-
__name$3(this, "TomlError");
|
|
1658
|
-
}
|
|
1659
|
-
line;
|
|
1660
|
-
column;
|
|
1661
|
-
codeblock;
|
|
1662
|
-
constructor(message, options) {
|
|
1663
|
-
const [line, column] = getLineColFromPtr$1(options.toml, options.ptr);
|
|
1664
|
-
const codeblock = makeCodeBlock$1(options.toml, line, column);
|
|
1665
|
-
super(`Invalid TOML document: ${message}
|
|
1666
|
-
|
|
1667
|
-
${codeblock}`, options);
|
|
1668
|
-
this.line = line;
|
|
1669
|
-
this.column = column;
|
|
1670
|
-
this.codeblock = codeblock;
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
|
-
function isEscaped$1(str, ptr) {
|
|
1674
|
-
let i = 0;
|
|
1675
|
-
while (str[ptr - ++i] === "\\");
|
|
1676
|
-
return --i && i % 2;
|
|
1677
|
-
}
|
|
1678
|
-
__name$3(isEscaped$1, "isEscaped");
|
|
1679
|
-
function indexOfNewline$1(str, start = 0, end = str.length) {
|
|
1680
|
-
let idx = str.indexOf("\n", start);
|
|
1681
|
-
if (str[idx - 1] === "\r") idx--;
|
|
1682
|
-
return idx <= end ? idx : -1;
|
|
1683
|
-
}
|
|
1684
|
-
__name$3(indexOfNewline$1, "indexOfNewline");
|
|
1685
|
-
function skipComment$1(str, ptr) {
|
|
1686
|
-
for (let i = ptr; i < str.length; i++) {
|
|
1687
|
-
let c$1 = str[i];
|
|
1688
|
-
if (c$1 === "\n") return i;
|
|
1689
|
-
if (c$1 === "\r" && str[i + 1] === "\n") return i + 1;
|
|
1690
|
-
if (c$1 < " " && c$1 !== " " || c$1 === "") throw new TomlError$1("control characters are not allowed in comments", {
|
|
1691
|
-
toml: str,
|
|
1692
|
-
ptr
|
|
1693
|
-
});
|
|
1694
|
-
}
|
|
1695
|
-
return str.length;
|
|
1696
|
-
}
|
|
1697
|
-
__name$3(skipComment$1, "skipComment");
|
|
1698
|
-
function skipVoid$1(str, ptr, banNewLines, banComments) {
|
|
1699
|
-
let c$1;
|
|
1700
|
-
while ((c$1 = str[ptr]) === " " || c$1 === " " || !banNewLines && (c$1 === "\n" || c$1 === "\r" && str[ptr + 1] === "\n")) ptr++;
|
|
1701
|
-
return banComments || c$1 !== "#" ? ptr : skipVoid$1(str, skipComment$1(str, ptr), banNewLines);
|
|
1702
|
-
}
|
|
1703
|
-
__name$3(skipVoid$1, "skipVoid");
|
|
1704
|
-
function skipUntil$1(str, ptr, sep, end, banNewLines = false) {
|
|
1705
|
-
if (!end) {
|
|
1706
|
-
ptr = indexOfNewline$1(str, ptr);
|
|
1707
|
-
return ptr < 0 ? str.length : ptr;
|
|
1708
|
-
}
|
|
1709
|
-
for (let i = ptr; i < str.length; i++) {
|
|
1710
|
-
let c$1 = str[i];
|
|
1711
|
-
if (c$1 === "#") i = indexOfNewline$1(str, i);
|
|
1712
|
-
else if (c$1 === sep) return i + 1;
|
|
1713
|
-
else if (c$1 === end || banNewLines && (c$1 === "\n" || c$1 === "\r" && str[i + 1] === "\n")) return i;
|
|
1714
|
-
}
|
|
1715
|
-
throw new TomlError$1("cannot find end of structure", {
|
|
1716
|
-
toml: str,
|
|
1717
|
-
ptr
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
__name$3(skipUntil$1, "skipUntil");
|
|
1721
|
-
function getStringEnd$1(str, seek) {
|
|
1722
|
-
let first = str[seek];
|
|
1723
|
-
let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
|
|
1724
|
-
seek += target.length - 1;
|
|
1725
|
-
do
|
|
1726
|
-
seek = str.indexOf(target, ++seek);
|
|
1727
|
-
while (seek > -1 && first !== "'" && isEscaped$1(str, seek));
|
|
1728
|
-
if (seek > -1) {
|
|
1729
|
-
seek += target.length;
|
|
1730
|
-
if (target.length > 1) {
|
|
1731
|
-
if (str[seek] === first) seek++;
|
|
1732
|
-
if (str[seek] === first) seek++;
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
return seek;
|
|
1736
|
-
}
|
|
1737
|
-
__name$3(getStringEnd$1, "getStringEnd");
|
|
1738
|
-
var DATE_TIME_RE$1 = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
1631
|
+
var DATE_TIME_RE$1 = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
1739
1632
|
var TomlDate$1 = class _TomlDate extends Date {
|
|
1740
1633
|
static {
|
|
1741
1634
|
__name$3(this, "TomlDate");
|
|
@@ -1819,305 +1712,380 @@ var TomlDate$1 = class _TomlDate extends Date {
|
|
|
1819
1712
|
return date$1;
|
|
1820
1713
|
}
|
|
1821
1714
|
};
|
|
1715
|
+
function getLineColFromPtr$1(string$1, ptr) {
|
|
1716
|
+
let lines = string$1.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
1717
|
+
return [lines.length, lines.pop().length + 1];
|
|
1718
|
+
}
|
|
1719
|
+
__name$3(getLineColFromPtr$1, "getLineColFromPtr");
|
|
1720
|
+
function makeCodeBlock$1(string$1, line, column) {
|
|
1721
|
+
let lines = string$1.split(/\r\n|\n|\r/g);
|
|
1722
|
+
let codeblock = "";
|
|
1723
|
+
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
1724
|
+
for (let i = line - 1; i <= line + 1; i++) {
|
|
1725
|
+
let l = lines[i - 1];
|
|
1726
|
+
if (!l) continue;
|
|
1727
|
+
codeblock += i.toString().padEnd(numberLen, " ");
|
|
1728
|
+
codeblock += ": ";
|
|
1729
|
+
codeblock += l;
|
|
1730
|
+
codeblock += "\n";
|
|
1731
|
+
if (i === line) {
|
|
1732
|
+
codeblock += " ".repeat(numberLen + column + 2);
|
|
1733
|
+
codeblock += "^\n";
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
return codeblock;
|
|
1737
|
+
}
|
|
1738
|
+
__name$3(makeCodeBlock$1, "makeCodeBlock");
|
|
1739
|
+
var TomlError$1 = class extends Error {
|
|
1740
|
+
static {
|
|
1741
|
+
__name$3(this, "TomlError");
|
|
1742
|
+
}
|
|
1743
|
+
line;
|
|
1744
|
+
column;
|
|
1745
|
+
codeblock;
|
|
1746
|
+
constructor(message, options) {
|
|
1747
|
+
const [line, column] = getLineColFromPtr$1(options.toml, options.ptr);
|
|
1748
|
+
const codeblock = makeCodeBlock$1(options.toml, line, column);
|
|
1749
|
+
super(`Invalid TOML document: ${message}
|
|
1750
|
+
|
|
1751
|
+
${codeblock}`, options);
|
|
1752
|
+
this.line = line;
|
|
1753
|
+
this.column = column;
|
|
1754
|
+
this.codeblock = codeblock;
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
function indexOfNewline$1(str, start = 0) {
|
|
1758
|
+
let idx = str.indexOf("\n", start);
|
|
1759
|
+
if (str.charCodeAt(idx - 1) === 13) idx--;
|
|
1760
|
+
return idx;
|
|
1761
|
+
}
|
|
1762
|
+
__name$3(indexOfNewline$1, "indexOfNewline");
|
|
1763
|
+
function skipComment$1(ctx) {
|
|
1764
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
1765
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
1766
|
+
if (c$1 === 10) break;
|
|
1767
|
+
if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
1768
|
+
ctx.p++;
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1771
|
+
if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError$1("control characters are not allowed in comments", {
|
|
1772
|
+
toml: ctx.s,
|
|
1773
|
+
ptr: ctx.p
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
__name$3(skipComment$1, "skipComment");
|
|
1778
|
+
function skipVoid$1(ctx, banNewLines, banComments) {
|
|
1779
|
+
let c$1;
|
|
1780
|
+
while (1) {
|
|
1781
|
+
while ((c$1 = ctx.s.charCodeAt(ctx.p)) === 32 || c$1 === 9 || !banNewLines && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) ctx.p++;
|
|
1782
|
+
if (banComments || c$1 !== 35) break;
|
|
1783
|
+
skipComment$1(ctx);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
__name$3(skipVoid$1, "skipVoid");
|
|
1787
|
+
function skipUntil$1(ctx, sep, end) {
|
|
1788
|
+
let ptr = ctx.p;
|
|
1789
|
+
if (!end) {
|
|
1790
|
+
ptr = indexOfNewline$1(ctx.s, ptr);
|
|
1791
|
+
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
1795
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
1796
|
+
if (c$1 === 35) skipComment$1(ctx);
|
|
1797
|
+
else if (c$1 === end || c$1 === sep) return;
|
|
1798
|
+
}
|
|
1799
|
+
throw new TomlError$1("cannot find end of structure", {
|
|
1800
|
+
toml: ctx.s,
|
|
1801
|
+
ptr
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
__name$3(skipUntil$1, "skipUntil");
|
|
1822
1805
|
var INT_REGEX$1 = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
1823
1806
|
var FLOAT_REGEX$1 = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
1824
1807
|
var LEADING_ZERO$1 = /^[+-]?0[0-9_]/;
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
r: "\r",
|
|
1832
|
-
"\"": "\"",
|
|
1833
|
-
"\\": "\\"
|
|
1834
|
-
};
|
|
1835
|
-
function parseString$1(str, ptr = 0, endPtr = str.length) {
|
|
1836
|
-
let isLiteral = str[ptr] === "'";
|
|
1837
|
-
let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
|
|
1808
|
+
function parseString$1(ctx) {
|
|
1809
|
+
let start = ctx.p;
|
|
1810
|
+
let c$1 = ctx.s.charCodeAt(ctx.p++);
|
|
1811
|
+
let first = c$1;
|
|
1812
|
+
let isLiteral = c$1 === 39;
|
|
1813
|
+
let isMultiline = c$1 === ctx.s.charCodeAt(ctx.p) && c$1 === ctx.s.charCodeAt(ctx.p + 1);
|
|
1838
1814
|
if (isMultiline) {
|
|
1839
|
-
|
|
1840
|
-
if (
|
|
1841
|
-
if (str[ptr] === "\n") ptr++;
|
|
1815
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p += 2)) === 10) ctx.p++;
|
|
1816
|
+
else if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) ctx.p += 2;
|
|
1842
1817
|
}
|
|
1843
|
-
let tmp = 0;
|
|
1844
|
-
let isEscape;
|
|
1845
1818
|
let parsed = "";
|
|
1846
|
-
let sliceStart =
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
if (
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
toml: str,
|
|
1878
|
-
ptr: tmp
|
|
1819
|
+
let sliceStart = ctx.p;
|
|
1820
|
+
let state = 0;
|
|
1821
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
1822
|
+
c$1 = ctx.s.charCodeAt(ctx.p);
|
|
1823
|
+
if (isMultiline && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) state = state && 3;
|
|
1824
|
+
else if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError$1("control characters are not allowed in strings", {
|
|
1825
|
+
toml: ctx.s,
|
|
1826
|
+
ptr: ctx.p
|
|
1827
|
+
});
|
|
1828
|
+
else if ((!state || state === 3) && c$1 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
1829
|
+
if (isMultiline) {
|
|
1830
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
1831
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
1832
|
+
}
|
|
1833
|
+
if (!state) parsed += ctx.s.slice(sliceStart, ctx.p);
|
|
1834
|
+
ctx.p += isMultiline ? 3 : 1;
|
|
1835
|
+
return parsed;
|
|
1836
|
+
} else if (!state) {
|
|
1837
|
+
if (!isLiteral && c$1 === 92) {
|
|
1838
|
+
parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
|
|
1839
|
+
state = 1;
|
|
1840
|
+
}
|
|
1841
|
+
} else if (state === 1) if (c$1 === 120 || c$1 === 117 || c$1 === 85) {
|
|
1842
|
+
let value = 0;
|
|
1843
|
+
let len = c$1 === 120 ? 2 : c$1 === 117 ? 4 : 8;
|
|
1844
|
+
for (let j$1 = 0; j$1 < len; j$1++, ctx.p++) {
|
|
1845
|
+
let hex$1 = ctx.s.charCodeAt(ctx.p + 1);
|
|
1846
|
+
let digit = hex$1 >= 48 && hex$1 <= 57 ? hex$1 - 48 : hex$1 >= 65 && hex$1 <= 70 ? hex$1 - 65 + 10 : hex$1 >= 97 && hex$1 <= 102 ? hex$1 - 97 + 10 : -1;
|
|
1847
|
+
if (digit < 0) throw new TomlError$1("invalid non-hex character in unicode escape", {
|
|
1848
|
+
toml: ctx.s,
|
|
1849
|
+
ptr: ctx.p + 1
|
|
1879
1850
|
});
|
|
1880
|
-
|
|
1881
|
-
}
|
|
1851
|
+
value = value << 4 | digit;
|
|
1852
|
+
}
|
|
1853
|
+
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) throw new TomlError$1("invalid unicode escape", {
|
|
1854
|
+
toml: ctx.s,
|
|
1855
|
+
ptr: ctx.p
|
|
1856
|
+
});
|
|
1857
|
+
parsed += String.fromCodePoint(value);
|
|
1858
|
+
sliceStart = ctx.p + 1;
|
|
1859
|
+
state = 0;
|
|
1860
|
+
} else if (c$1 === 32 || c$1 === 9) state = 2;
|
|
1861
|
+
else {
|
|
1862
|
+
if (c$1 === 98) parsed += "\b";
|
|
1863
|
+
else if (c$1 === 116) parsed += " ";
|
|
1864
|
+
else if (c$1 === 110) parsed += "\n";
|
|
1865
|
+
else if (c$1 === 102) parsed += "\f";
|
|
1866
|
+
else if (c$1 === 114) parsed += "\r";
|
|
1867
|
+
else if (c$1 === 101) parsed += "\x1B";
|
|
1868
|
+
else if (c$1 === 34) parsed += "\"";
|
|
1869
|
+
else if (c$1 === 92) parsed += "\\";
|
|
1882
1870
|
else throw new TomlError$1("unrecognized escape sequence", {
|
|
1883
|
-
toml:
|
|
1884
|
-
ptr:
|
|
1871
|
+
toml: ctx.s,
|
|
1872
|
+
ptr: ctx.p
|
|
1873
|
+
});
|
|
1874
|
+
sliceStart = ctx.p + 1;
|
|
1875
|
+
state = 0;
|
|
1876
|
+
}
|
|
1877
|
+
else if (c$1 !== 32 && c$1 !== 9) {
|
|
1878
|
+
if (state === 2) throw new TomlError$1("invalid escape: only line-ending whitespace may be escaped", {
|
|
1879
|
+
toml: ctx.s,
|
|
1880
|
+
ptr: sliceStart
|
|
1885
1881
|
});
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
tmp = ptr - 1;
|
|
1889
|
-
isEscape = true;
|
|
1890
|
-
parsed += str.slice(sliceStart, tmp);
|
|
1882
|
+
state = !isLiteral && c$1 === 92 ? 1 : 0;
|
|
1883
|
+
sliceStart = ctx.p;
|
|
1891
1884
|
}
|
|
1892
1885
|
}
|
|
1893
|
-
|
|
1886
|
+
throw new TomlError$1("unfinished string", {
|
|
1887
|
+
toml: ctx.s,
|
|
1888
|
+
ptr: start
|
|
1889
|
+
});
|
|
1894
1890
|
}
|
|
1895
1891
|
__name$3(parseString$1, "parseString");
|
|
1896
|
-
function
|
|
1897
|
-
|
|
1898
|
-
|
|
1892
|
+
function sliceAndTrimEndOf$1(ctx, start, end) {
|
|
1893
|
+
let value = ctx.s.slice(start, end);
|
|
1894
|
+
let commentIdx = value.indexOf("#");
|
|
1895
|
+
if (commentIdx > 0) {
|
|
1896
|
+
skipComment$1({
|
|
1897
|
+
s: value,
|
|
1898
|
+
p: commentIdx
|
|
1899
|
+
});
|
|
1900
|
+
value = value.slice(0, commentIdx);
|
|
1901
|
+
}
|
|
1902
|
+
return value.trimEnd();
|
|
1903
|
+
}
|
|
1904
|
+
__name$3(sliceAndTrimEndOf$1, "sliceAndTrimEndOf");
|
|
1905
|
+
function parseValue$1(ctx, integersAsBigInt, end) {
|
|
1906
|
+
let ptr = ctx.p;
|
|
1907
|
+
let err = {
|
|
1908
|
+
toml: ctx.s,
|
|
1909
|
+
ptr
|
|
1910
|
+
};
|
|
1911
|
+
skipUntil$1(ctx, 44, end);
|
|
1912
|
+
let value = sliceAndTrimEndOf$1(ctx, ptr, ctx.p);
|
|
1913
|
+
if (!value) throw new TomlError$1("incomplete declaration: value expected", err);
|
|
1899
1914
|
if (value === "-inf") return -Infinity;
|
|
1900
1915
|
if (value === "inf" || value === "+inf") return Infinity;
|
|
1901
1916
|
if (value === "nan" || value === "+nan" || value === "-nan") return NaN;
|
|
1902
1917
|
if (value === "-0") return integersAsBigInt ? 0n : 0;
|
|
1903
1918
|
let isInt = INT_REGEX$1.test(value);
|
|
1904
1919
|
if (isInt || FLOAT_REGEX$1.test(value)) {
|
|
1905
|
-
if (LEADING_ZERO$1.test(value)) throw new TomlError$1("leading zeroes are not allowed",
|
|
1906
|
-
toml,
|
|
1907
|
-
ptr
|
|
1908
|
-
});
|
|
1920
|
+
if (LEADING_ZERO$1.test(value)) throw new TomlError$1("leading zeroes are not allowed", err);
|
|
1909
1921
|
value = value.replace(/_/g, "");
|
|
1910
1922
|
let numeric$1 = +value;
|
|
1911
|
-
if (isNaN(numeric$1)) throw new TomlError$1("invalid number",
|
|
1912
|
-
toml,
|
|
1913
|
-
ptr
|
|
1914
|
-
});
|
|
1923
|
+
if (isNaN(numeric$1)) throw new TomlError$1("invalid number", err);
|
|
1915
1924
|
if (isInt) {
|
|
1916
|
-
if ((isInt = !Number.isSafeInteger(numeric$1)) && !integersAsBigInt) throw new TomlError$1("integer value cannot be represented losslessly",
|
|
1917
|
-
toml,
|
|
1918
|
-
ptr
|
|
1919
|
-
});
|
|
1925
|
+
if ((isInt = !Number.isSafeInteger(numeric$1)) && !integersAsBigInt) throw new TomlError$1("integer value cannot be represented losslessly", err);
|
|
1920
1926
|
if (isInt || integersAsBigInt === true) numeric$1 = BigInt(value);
|
|
1921
1927
|
}
|
|
1922
1928
|
return numeric$1;
|
|
1923
1929
|
}
|
|
1924
1930
|
const date$1 = new TomlDate$1(value);
|
|
1925
|
-
if (!date$1.isValid()) throw new TomlError$1("invalid value",
|
|
1926
|
-
toml,
|
|
1927
|
-
ptr
|
|
1928
|
-
});
|
|
1931
|
+
if (!date$1.isValid()) throw new TomlError$1("invalid value", err);
|
|
1929
1932
|
return date$1;
|
|
1930
1933
|
}
|
|
1931
1934
|
__name$3(parseValue$1, "parseValue");
|
|
1932
|
-
function
|
|
1933
|
-
let
|
|
1934
|
-
let
|
|
1935
|
-
if (
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
let trimmed = value.trimEnd();
|
|
1940
|
-
if (!allowNewLines) {
|
|
1941
|
-
let newlineIdx = value.indexOf("\n", trimmed.length);
|
|
1942
|
-
if (newlineIdx > -1) throw new TomlError$1("newlines are not allowed in inline tables", {
|
|
1943
|
-
toml: str,
|
|
1944
|
-
ptr: startPtr + newlineIdx
|
|
1935
|
+
function extractValue$1(ctx, end, integersAsBigInt) {
|
|
1936
|
+
let ptr = ctx.p;
|
|
1937
|
+
let c$1 = ctx.s.charCodeAt(ptr);
|
|
1938
|
+
if (c$1 === 91 || c$1 === 123) {
|
|
1939
|
+
if (!ctx.d--) throw new TomlError$1("document contains excessively nested structures. aborting.", {
|
|
1940
|
+
toml: ctx.s,
|
|
1941
|
+
ptr
|
|
1945
1942
|
});
|
|
1943
|
+
let value = c$1 === 91 ? parseArray$1(ctx, integersAsBigInt) : parseInlineTable$1(ctx, integersAsBigInt);
|
|
1944
|
+
ctx.d++;
|
|
1945
|
+
return value;
|
|
1946
1946
|
}
|
|
1947
|
-
return
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
let c$1 = str[ptr];
|
|
1956
|
-
if (c$1 === "[" || c$1 === "{") {
|
|
1957
|
-
let [value, endPtr2] = c$1 === "[" ? parseArray$1(str, ptr, depth, integersAsBigInt) : parseInlineTable$1(str, ptr, depth, integersAsBigInt);
|
|
1958
|
-
let newPtr = end ? skipUntil$1(str, endPtr2, ",", end) : endPtr2;
|
|
1959
|
-
if (endPtr2 - newPtr && end === "}") {
|
|
1960
|
-
let nextNewLine = indexOfNewline$1(str, endPtr2, newPtr);
|
|
1961
|
-
if (nextNewLine > -1) throw new TomlError$1("newlines are not allowed in inline tables", {
|
|
1962
|
-
toml: str,
|
|
1963
|
-
ptr: nextNewLine
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
return [value, newPtr];
|
|
1967
|
-
}
|
|
1968
|
-
let endPtr;
|
|
1969
|
-
if (c$1 === "\"" || c$1 === "'") {
|
|
1970
|
-
endPtr = getStringEnd$1(str, ptr);
|
|
1971
|
-
let parsed = parseString$1(str, ptr, endPtr);
|
|
1972
|
-
if (end) {
|
|
1973
|
-
endPtr = skipVoid$1(str, endPtr, end !== "]");
|
|
1974
|
-
if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") throw new TomlError$1("unexpected character encountered", {
|
|
1975
|
-
toml: str,
|
|
1976
|
-
ptr: endPtr
|
|
1977
|
-
});
|
|
1978
|
-
endPtr += +(str[endPtr] === ",");
|
|
1979
|
-
}
|
|
1980
|
-
return [parsed, endPtr];
|
|
1947
|
+
if (c$1 === 34 || c$1 === 39) return parseString$1(ctx);
|
|
1948
|
+
if (c$1 === 116) {
|
|
1949
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError$1("invalid value", {
|
|
1950
|
+
toml: ctx.s,
|
|
1951
|
+
ptr
|
|
1952
|
+
});
|
|
1953
|
+
ctx.p++;
|
|
1954
|
+
return true;
|
|
1981
1955
|
}
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
endPtr = skipVoid$1(str, ptr + slice[1]);
|
|
1990
|
-
endPtr += +(str[endPtr] === ",");
|
|
1956
|
+
if (c$1 === 102) {
|
|
1957
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError$1("invalid value", {
|
|
1958
|
+
toml: ctx.s,
|
|
1959
|
+
ptr
|
|
1960
|
+
});
|
|
1961
|
+
ctx.p++;
|
|
1962
|
+
return false;
|
|
1991
1963
|
}
|
|
1992
|
-
return
|
|
1964
|
+
return parseValue$1(ctx, integersAsBigInt, end);
|
|
1993
1965
|
}
|
|
1994
1966
|
__name$3(extractValue$1, "extractValue");
|
|
1995
1967
|
var KEY_PART_RE$1 = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
1996
|
-
function parseKey$1(
|
|
1997
|
-
let
|
|
1968
|
+
function parseKey$1(ctx, end = "=") {
|
|
1969
|
+
let start = ctx.p;
|
|
1970
|
+
let dot = start - 1;
|
|
1998
1971
|
let parsed = [];
|
|
1999
|
-
let endPtr =
|
|
1972
|
+
let endPtr = ctx.s.indexOf(end, start);
|
|
2000
1973
|
if (endPtr < 0) throw new TomlError$1("incomplete key-value: cannot find end of key", {
|
|
2001
|
-
toml:
|
|
2002
|
-
ptr
|
|
1974
|
+
toml: ctx.s,
|
|
1975
|
+
ptr: start
|
|
2003
1976
|
});
|
|
2004
1977
|
do {
|
|
2005
|
-
let c$1 =
|
|
2006
|
-
if (c$1 !==
|
|
2007
|
-
if (c$1 ===
|
|
2008
|
-
toml:
|
|
2009
|
-
ptr
|
|
2010
|
-
});
|
|
2011
|
-
let
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
ptr
|
|
2015
|
-
});
|
|
2016
|
-
dot = str.indexOf(".", eos);
|
|
2017
|
-
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
1978
|
+
let c$1 = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
1979
|
+
if (c$1 !== 32 && c$1 !== 9) if (c$1 === 34 || c$1 === 39) {
|
|
1980
|
+
if (c$1 === ctx.s.charCodeAt(ctx.p + 1) && c$1 === ctx.s.charCodeAt(ctx.p + 2)) throw new TomlError$1("multiline strings are not allowed in keys", {
|
|
1981
|
+
toml: ctx.s,
|
|
1982
|
+
ptr: ctx.p
|
|
1983
|
+
});
|
|
1984
|
+
let part = parseString$1(ctx);
|
|
1985
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
1986
|
+
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
2018
1987
|
let newLine = indexOfNewline$1(strEnd);
|
|
2019
1988
|
if (newLine > -1) throw new TomlError$1("newlines are not allowed in keys", {
|
|
2020
|
-
toml:
|
|
2021
|
-
ptr:
|
|
1989
|
+
toml: ctx.s,
|
|
1990
|
+
ptr: newLine
|
|
2022
1991
|
});
|
|
2023
1992
|
if (strEnd.trimStart()) throw new TomlError$1("found extra tokens after the string part", {
|
|
2024
|
-
toml:
|
|
2025
|
-
ptr:
|
|
1993
|
+
toml: ctx.s,
|
|
1994
|
+
ptr: ctx.p
|
|
2026
1995
|
});
|
|
2027
|
-
if (endPtr <
|
|
2028
|
-
endPtr =
|
|
1996
|
+
if (endPtr < ctx.p) {
|
|
1997
|
+
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
2029
1998
|
if (endPtr < 0) throw new TomlError$1("incomplete key-value: cannot find end of key", {
|
|
2030
|
-
toml:
|
|
2031
|
-
ptr
|
|
1999
|
+
toml: ctx.s,
|
|
2000
|
+
ptr: start
|
|
2032
2001
|
});
|
|
2033
2002
|
}
|
|
2034
|
-
parsed.push(
|
|
2003
|
+
parsed.push(part);
|
|
2035
2004
|
} else {
|
|
2036
|
-
dot =
|
|
2037
|
-
let part =
|
|
2005
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
2006
|
+
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
2038
2007
|
if (!KEY_PART_RE$1.test(part)) throw new TomlError$1("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
2039
|
-
toml:
|
|
2040
|
-
ptr
|
|
2008
|
+
toml: ctx.s,
|
|
2009
|
+
ptr: ctx.p
|
|
2041
2010
|
});
|
|
2042
2011
|
parsed.push(part.trimEnd());
|
|
2043
2012
|
}
|
|
2044
2013
|
} while (dot + 1 && dot < endPtr);
|
|
2045
|
-
|
|
2014
|
+
ctx.p = endPtr + 1;
|
|
2015
|
+
skipVoid$1(ctx, true, true);
|
|
2016
|
+
return parsed;
|
|
2046
2017
|
}
|
|
2047
2018
|
__name$3(parseKey$1, "parseKey");
|
|
2048
|
-
function parseInlineTable$1(
|
|
2019
|
+
function parseInlineTable$1(ctx, integersAsBigInt) {
|
|
2049
2020
|
let res = {};
|
|
2050
2021
|
let seen = /* @__PURE__ */ new Set();
|
|
2051
2022
|
let c$1;
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
enumerable: true,
|
|
2076
|
-
configurable: true,
|
|
2077
|
-
writable: true
|
|
2078
|
-
});
|
|
2079
|
-
}
|
|
2080
|
-
if (hasOwn) throw new TomlError$1("trying to redefine an already defined value", {
|
|
2081
|
-
toml: str,
|
|
2082
|
-
ptr
|
|
2023
|
+
ctx.p++;
|
|
2024
|
+
while (ctx.p < ctx.s.length) {
|
|
2025
|
+
skipVoid$1(ctx);
|
|
2026
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
2027
|
+
ctx.p++;
|
|
2028
|
+
return res;
|
|
2029
|
+
}
|
|
2030
|
+
let k;
|
|
2031
|
+
let t$4 = res;
|
|
2032
|
+
let hasOwn = false;
|
|
2033
|
+
let p$1 = ctx.p;
|
|
2034
|
+
let key = parseKey$1(ctx);
|
|
2035
|
+
for (let i = 0; i < key.length; i++) {
|
|
2036
|
+
if (i) t$4 = hasOwn ? t$4[k] : t$4[k] = {};
|
|
2037
|
+
k = key[i];
|
|
2038
|
+
if ((hasOwn = Object.hasOwn(t$4, k)) && (typeof t$4[k] !== "object" || seen.has(t$4[k]))) throw new TomlError$1("trying to redefine an already defined value", {
|
|
2039
|
+
toml: ctx.s,
|
|
2040
|
+
ptr: p$1
|
|
2041
|
+
});
|
|
2042
|
+
if (!hasOwn && k === "__proto__") Object.defineProperty(t$4, k, {
|
|
2043
|
+
enumerable: true,
|
|
2044
|
+
configurable: true,
|
|
2045
|
+
writable: true
|
|
2083
2046
|
});
|
|
2084
|
-
let [value, valueEndPtr] = extractValue$1(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
|
|
2085
|
-
seen.add(value);
|
|
2086
|
-
t$4[k] = value;
|
|
2087
|
-
ptr = valueEndPtr;
|
|
2088
|
-
comma = str[ptr - 1] === "," ? ptr - 1 : 0;
|
|
2089
2047
|
}
|
|
2048
|
+
if (hasOwn) throw new TomlError$1("trying to redefine an already defined value", {
|
|
2049
|
+
toml: ctx.s,
|
|
2050
|
+
ptr: ctx.p
|
|
2051
|
+
});
|
|
2052
|
+
let value = extractValue$1(ctx, 125, integersAsBigInt);
|
|
2053
|
+
seen.add(t$4[k] = value);
|
|
2054
|
+
skipVoid$1(ctx);
|
|
2055
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 125) return res;
|
|
2056
|
+
if (c$1 !== 44) throw new TomlError$1("expected comma or end of structure", {
|
|
2057
|
+
toml: ctx.s,
|
|
2058
|
+
ptr: ctx.p - 1
|
|
2059
|
+
});
|
|
2090
2060
|
}
|
|
2091
|
-
|
|
2092
|
-
toml:
|
|
2093
|
-
ptr:
|
|
2094
|
-
});
|
|
2095
|
-
if (!c$1) throw new TomlError$1("unfinished table encountered", {
|
|
2096
|
-
toml: str,
|
|
2097
|
-
ptr
|
|
2061
|
+
throw new TomlError$1("unfinished table encountered", {
|
|
2062
|
+
toml: ctx.s,
|
|
2063
|
+
ptr: ctx.p
|
|
2098
2064
|
});
|
|
2099
|
-
return [res, ptr];
|
|
2100
2065
|
}
|
|
2101
2066
|
__name$3(parseInlineTable$1, "parseInlineTable");
|
|
2102
|
-
function parseArray$1(
|
|
2067
|
+
function parseArray$1(ctx, integersAsBigInt) {
|
|
2103
2068
|
let res = [];
|
|
2104
2069
|
let c$1;
|
|
2105
|
-
|
|
2106
|
-
while (
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2070
|
+
ctx.p++;
|
|
2071
|
+
while (ctx.p < ctx.s.length) {
|
|
2072
|
+
skipVoid$1(ctx);
|
|
2073
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
2074
|
+
ctx.p++;
|
|
2075
|
+
return res;
|
|
2076
|
+
}
|
|
2077
|
+
res.push(extractValue$1(ctx, 93, integersAsBigInt));
|
|
2078
|
+
skipVoid$1(ctx);
|
|
2079
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 93) return res;
|
|
2080
|
+
if (c$1 !== 44) throw new TomlError$1("expected comma or end of structure", {
|
|
2081
|
+
toml: ctx.s,
|
|
2082
|
+
ptr: ctx.p - 1
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
throw new TomlError$1("unfinished array encountered", {
|
|
2086
|
+
toml: ctx.s,
|
|
2087
|
+
ptr: ctx.p
|
|
2119
2088
|
});
|
|
2120
|
-
return [res, ptr];
|
|
2121
2089
|
}
|
|
2122
2090
|
__name$3(parseArray$1, "parseArray");
|
|
2123
2091
|
function peekTable$1(key, table, meta$1, type) {
|
|
@@ -2187,46 +2155,51 @@ function peekTable$1(key, table, meta$1, type) {
|
|
|
2187
2155
|
}
|
|
2188
2156
|
__name$3(peekTable$1, "peekTable");
|
|
2189
2157
|
function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
2158
|
+
let ctx = {
|
|
2159
|
+
s: toml,
|
|
2160
|
+
p: 0,
|
|
2161
|
+
d: maxDepth
|
|
2162
|
+
};
|
|
2190
2163
|
let res = {};
|
|
2191
2164
|
let meta$1 = {};
|
|
2165
|
+
let tmp;
|
|
2192
2166
|
let tbl = res;
|
|
2193
2167
|
let m = meta$1;
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
let
|
|
2168
|
+
skipVoid$1(ctx);
|
|
2169
|
+
while (ctx.p < toml.length) {
|
|
2170
|
+
if (toml.charCodeAt(ctx.p) === 91) {
|
|
2171
|
+
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
2172
|
+
tmp = ctx.p += +isTableArray;
|
|
2173
|
+
let k = parseKey$1(ctx, "]");
|
|
2198
2174
|
if (isTableArray) {
|
|
2199
|
-
if (toml
|
|
2175
|
+
if (toml.charCodeAt(ctx.p - 1) !== 93) throw new TomlError$1("expected end of table declaration", {
|
|
2200
2176
|
toml,
|
|
2201
|
-
ptr:
|
|
2177
|
+
ptr: ctx.p - 1
|
|
2202
2178
|
});
|
|
2203
|
-
|
|
2179
|
+
ctx.p++;
|
|
2204
2180
|
}
|
|
2205
|
-
let p$1 = peekTable$1(k
|
|
2181
|
+
let p$1 = peekTable$1(k, res, meta$1, isTableArray ? 2 : 1);
|
|
2206
2182
|
if (!p$1) throw new TomlError$1("trying to redefine an already defined table or value", {
|
|
2207
2183
|
toml,
|
|
2208
|
-
ptr
|
|
2184
|
+
ptr: tmp
|
|
2209
2185
|
});
|
|
2210
2186
|
m = p$1[2];
|
|
2211
2187
|
tbl = p$1[1];
|
|
2212
|
-
ptr = k[1];
|
|
2213
2188
|
} else {
|
|
2214
|
-
|
|
2215
|
-
let p$1 = peekTable$1(
|
|
2189
|
+
tmp = ctx.p;
|
|
2190
|
+
let p$1 = peekTable$1(parseKey$1(ctx), tbl, m, 0);
|
|
2216
2191
|
if (!p$1) throw new TomlError$1("trying to redefine an already defined table or value", {
|
|
2217
2192
|
toml,
|
|
2218
|
-
ptr
|
|
2193
|
+
ptr: tmp
|
|
2219
2194
|
});
|
|
2220
|
-
|
|
2221
|
-
p$1[1][p$1[0]] = v[0];
|
|
2222
|
-
ptr = v[1];
|
|
2195
|
+
p$1[1][p$1[0]] = extractValue$1(ctx, void 0, integersAsBigInt);
|
|
2223
2196
|
}
|
|
2224
|
-
|
|
2225
|
-
if (toml
|
|
2197
|
+
skipVoid$1(ctx, true);
|
|
2198
|
+
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) throw new TomlError$1("each key-value declaration must be followed by an end-of-line", {
|
|
2226
2199
|
toml,
|
|
2227
|
-
ptr
|
|
2200
|
+
ptr: ctx.p
|
|
2228
2201
|
});
|
|
2229
|
-
|
|
2202
|
+
skipVoid$1(ctx);
|
|
2230
2203
|
}
|
|
2231
2204
|
return res;
|
|
2232
2205
|
}
|
|
@@ -2236,7 +2209,8 @@ function extendedTypeOf$1(obj) {
|
|
|
2236
2209
|
let type = typeof obj;
|
|
2237
2210
|
if (type === "object") {
|
|
2238
2211
|
if (Array.isArray(obj)) return "array";
|
|
2239
|
-
if (obj instanceof Date) return "date";
|
|
2212
|
+
if (typeof obj?.getUTCDate === "function" && obj instanceof Date) return "date";
|
|
2213
|
+
if (globalThis.Temporal && typeof obj?.since === "function" && (obj instanceof Temporal.Instant || obj instanceof Temporal.PlainDate || obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainTime || obj instanceof Temporal.ZonedDateTime)) return "temporal";
|
|
2240
2214
|
}
|
|
2241
2215
|
return type;
|
|
2242
2216
|
}
|
|
@@ -2250,23 +2224,31 @@ function formatString$1(s) {
|
|
|
2250
2224
|
return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
|
|
2251
2225
|
}
|
|
2252
2226
|
__name$3(formatString$1, "formatString");
|
|
2227
|
+
function stringifyTemporal$1(temporal) {
|
|
2228
|
+
return temporal.toString({
|
|
2229
|
+
calendarName: "never",
|
|
2230
|
+
timeZoneName: "never"
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
__name$3(stringifyTemporal$1, "stringifyTemporal");
|
|
2253
2234
|
function stringifyValue$1(val, type, depth, numberAsFloat) {
|
|
2254
2235
|
if (depth === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2236
|
+
switch (type) {
|
|
2237
|
+
case "number":
|
|
2238
|
+
if (isNaN(val)) return "nan";
|
|
2239
|
+
if (val === Infinity) return "inf";
|
|
2240
|
+
if (val === -Infinity) return "-inf";
|
|
2241
|
+
if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val))) return val.toFixed(1);
|
|
2242
|
+
case "bigint":
|
|
2243
|
+
case "boolean": return val.toString();
|
|
2244
|
+
case "string": return formatString$1(val);
|
|
2245
|
+
case "date":
|
|
2246
|
+
if (isNaN(val.getTime())) throw new TypeError("cannot serialize invalid date");
|
|
2247
|
+
return val.toISOString();
|
|
2248
|
+
case "object": return stringifyInlineTable$1(val, depth, numberAsFloat);
|
|
2249
|
+
case "array": return stringifyArray$1(val, depth, numberAsFloat);
|
|
2250
|
+
case "temporal": return stringifyTemporal$1(val);
|
|
2251
|
+
}
|
|
2270
2252
|
}
|
|
2271
2253
|
__name$3(stringifyValue$1, "stringifyValue");
|
|
2272
2254
|
function stringifyInlineTable$1(obj, depth, numberAsFloat) {
|
|
@@ -52718,7 +52700,7 @@ var __name$2 = (target, value) => __defProp$2(target, "name", {
|
|
|
52718
52700
|
});
|
|
52719
52701
|
|
|
52720
52702
|
//#endregion
|
|
52721
|
-
//#region ../workers-auth/dist/chunk-
|
|
52703
|
+
//#region ../workers-auth/dist/chunk-4CJO23DA.mjs
|
|
52722
52704
|
var import_undici$2 = require_undici();
|
|
52723
52705
|
var hasWarnedAboutDeprecatedV1ApiToken = false;
|
|
52724
52706
|
function readStoredAuthState(options) {
|
|
@@ -54207,114 +54189,7 @@ function getProfileForDirectoryFromBindings(startDir, bindings) {
|
|
|
54207
54189
|
}
|
|
54208
54190
|
}
|
|
54209
54191
|
__name$2(getProfileForDirectoryFromBindings, "getProfileForDirectoryFromBindings");
|
|
54210
|
-
|
|
54211
|
-
let lines = string$1.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
54212
|
-
return [lines.length, lines.pop().length + 1];
|
|
54213
|
-
}
|
|
54214
|
-
__name$2(getLineColFromPtr, "getLineColFromPtr");
|
|
54215
|
-
function makeCodeBlock(string$1, line, column) {
|
|
54216
|
-
let lines = string$1.split(/\r\n|\n|\r/g);
|
|
54217
|
-
let codeblock = "";
|
|
54218
|
-
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
54219
|
-
for (let i = line - 1; i <= line + 1; i++) {
|
|
54220
|
-
let l = lines[i - 1];
|
|
54221
|
-
if (!l) continue;
|
|
54222
|
-
codeblock += i.toString().padEnd(numberLen, " ");
|
|
54223
|
-
codeblock += ": ";
|
|
54224
|
-
codeblock += l;
|
|
54225
|
-
codeblock += "\n";
|
|
54226
|
-
if (i === line) {
|
|
54227
|
-
codeblock += " ".repeat(numberLen + column + 2);
|
|
54228
|
-
codeblock += "^\n";
|
|
54229
|
-
}
|
|
54230
|
-
}
|
|
54231
|
-
return codeblock;
|
|
54232
|
-
}
|
|
54233
|
-
__name$2(makeCodeBlock, "makeCodeBlock");
|
|
54234
|
-
var TomlError = class extends Error {
|
|
54235
|
-
static {
|
|
54236
|
-
__name$2(this, "TomlError");
|
|
54237
|
-
}
|
|
54238
|
-
line;
|
|
54239
|
-
column;
|
|
54240
|
-
codeblock;
|
|
54241
|
-
constructor(message, options) {
|
|
54242
|
-
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
54243
|
-
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
54244
|
-
super(`Invalid TOML document: ${message}
|
|
54245
|
-
|
|
54246
|
-
${codeblock}`, options);
|
|
54247
|
-
this.line = line;
|
|
54248
|
-
this.column = column;
|
|
54249
|
-
this.codeblock = codeblock;
|
|
54250
|
-
}
|
|
54251
|
-
};
|
|
54252
|
-
function isEscaped(str, ptr) {
|
|
54253
|
-
let i = 0;
|
|
54254
|
-
while (str[ptr - ++i] === "\\");
|
|
54255
|
-
return --i && i % 2;
|
|
54256
|
-
}
|
|
54257
|
-
__name$2(isEscaped, "isEscaped");
|
|
54258
|
-
function indexOfNewline(str, start = 0, end = str.length) {
|
|
54259
|
-
let idx = str.indexOf("\n", start);
|
|
54260
|
-
if (str[idx - 1] === "\r") idx--;
|
|
54261
|
-
return idx <= end ? idx : -1;
|
|
54262
|
-
}
|
|
54263
|
-
__name$2(indexOfNewline, "indexOfNewline");
|
|
54264
|
-
function skipComment(str, ptr) {
|
|
54265
|
-
for (let i = ptr; i < str.length; i++) {
|
|
54266
|
-
let c$1 = str[i];
|
|
54267
|
-
if (c$1 === "\n") return i;
|
|
54268
|
-
if (c$1 === "\r" && str[i + 1] === "\n") return i + 1;
|
|
54269
|
-
if (c$1 < " " && c$1 !== " " || c$1 === "") throw new TomlError("control characters are not allowed in comments", {
|
|
54270
|
-
toml: str,
|
|
54271
|
-
ptr
|
|
54272
|
-
});
|
|
54273
|
-
}
|
|
54274
|
-
return str.length;
|
|
54275
|
-
}
|
|
54276
|
-
__name$2(skipComment, "skipComment");
|
|
54277
|
-
function skipVoid(str, ptr, banNewLines, banComments) {
|
|
54278
|
-
let c$1;
|
|
54279
|
-
while ((c$1 = str[ptr]) === " " || c$1 === " " || !banNewLines && (c$1 === "\n" || c$1 === "\r" && str[ptr + 1] === "\n")) ptr++;
|
|
54280
|
-
return banComments || c$1 !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
|
|
54281
|
-
}
|
|
54282
|
-
__name$2(skipVoid, "skipVoid");
|
|
54283
|
-
function skipUntil(str, ptr, sep, end, banNewLines = false) {
|
|
54284
|
-
if (!end) {
|
|
54285
|
-
ptr = indexOfNewline(str, ptr);
|
|
54286
|
-
return ptr < 0 ? str.length : ptr;
|
|
54287
|
-
}
|
|
54288
|
-
for (let i = ptr; i < str.length; i++) {
|
|
54289
|
-
let c$1 = str[i];
|
|
54290
|
-
if (c$1 === "#") i = indexOfNewline(str, i);
|
|
54291
|
-
else if (c$1 === sep) return i + 1;
|
|
54292
|
-
else if (c$1 === end || banNewLines && (c$1 === "\n" || c$1 === "\r" && str[i + 1] === "\n")) return i;
|
|
54293
|
-
}
|
|
54294
|
-
throw new TomlError("cannot find end of structure", {
|
|
54295
|
-
toml: str,
|
|
54296
|
-
ptr
|
|
54297
|
-
});
|
|
54298
|
-
}
|
|
54299
|
-
__name$2(skipUntil, "skipUntil");
|
|
54300
|
-
function getStringEnd(str, seek) {
|
|
54301
|
-
let first = str[seek];
|
|
54302
|
-
let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
|
|
54303
|
-
seek += target.length - 1;
|
|
54304
|
-
do
|
|
54305
|
-
seek = str.indexOf(target, ++seek);
|
|
54306
|
-
while (seek > -1 && first !== "'" && isEscaped(str, seek));
|
|
54307
|
-
if (seek > -1) {
|
|
54308
|
-
seek += target.length;
|
|
54309
|
-
if (target.length > 1) {
|
|
54310
|
-
if (str[seek] === first) seek++;
|
|
54311
|
-
if (str[seek] === first) seek++;
|
|
54312
|
-
}
|
|
54313
|
-
}
|
|
54314
|
-
return seek;
|
|
54315
|
-
}
|
|
54316
|
-
__name$2(getStringEnd, "getStringEnd");
|
|
54317
|
-
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
54192
|
+
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
54318
54193
|
var TomlDate = class _TomlDate extends Date {
|
|
54319
54194
|
static {
|
|
54320
54195
|
__name$2(this, "TomlDate");
|
|
@@ -54398,305 +54273,380 @@ var TomlDate = class _TomlDate extends Date {
|
|
|
54398
54273
|
return date$1;
|
|
54399
54274
|
}
|
|
54400
54275
|
};
|
|
54276
|
+
function getLineColFromPtr(string$1, ptr) {
|
|
54277
|
+
let lines = string$1.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
54278
|
+
return [lines.length, lines.pop().length + 1];
|
|
54279
|
+
}
|
|
54280
|
+
__name$2(getLineColFromPtr, "getLineColFromPtr");
|
|
54281
|
+
function makeCodeBlock(string$1, line, column) {
|
|
54282
|
+
let lines = string$1.split(/\r\n|\n|\r/g);
|
|
54283
|
+
let codeblock = "";
|
|
54284
|
+
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
54285
|
+
for (let i = line - 1; i <= line + 1; i++) {
|
|
54286
|
+
let l = lines[i - 1];
|
|
54287
|
+
if (!l) continue;
|
|
54288
|
+
codeblock += i.toString().padEnd(numberLen, " ");
|
|
54289
|
+
codeblock += ": ";
|
|
54290
|
+
codeblock += l;
|
|
54291
|
+
codeblock += "\n";
|
|
54292
|
+
if (i === line) {
|
|
54293
|
+
codeblock += " ".repeat(numberLen + column + 2);
|
|
54294
|
+
codeblock += "^\n";
|
|
54295
|
+
}
|
|
54296
|
+
}
|
|
54297
|
+
return codeblock;
|
|
54298
|
+
}
|
|
54299
|
+
__name$2(makeCodeBlock, "makeCodeBlock");
|
|
54300
|
+
var TomlError = class extends Error {
|
|
54301
|
+
static {
|
|
54302
|
+
__name$2(this, "TomlError");
|
|
54303
|
+
}
|
|
54304
|
+
line;
|
|
54305
|
+
column;
|
|
54306
|
+
codeblock;
|
|
54307
|
+
constructor(message, options) {
|
|
54308
|
+
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
54309
|
+
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
54310
|
+
super(`Invalid TOML document: ${message}
|
|
54311
|
+
|
|
54312
|
+
${codeblock}`, options);
|
|
54313
|
+
this.line = line;
|
|
54314
|
+
this.column = column;
|
|
54315
|
+
this.codeblock = codeblock;
|
|
54316
|
+
}
|
|
54317
|
+
};
|
|
54318
|
+
function indexOfNewline(str, start = 0) {
|
|
54319
|
+
let idx = str.indexOf("\n", start);
|
|
54320
|
+
if (str.charCodeAt(idx - 1) === 13) idx--;
|
|
54321
|
+
return idx;
|
|
54322
|
+
}
|
|
54323
|
+
__name$2(indexOfNewline, "indexOfNewline");
|
|
54324
|
+
function skipComment(ctx) {
|
|
54325
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
54326
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
54327
|
+
if (c$1 === 10) break;
|
|
54328
|
+
if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
54329
|
+
ctx.p++;
|
|
54330
|
+
break;
|
|
54331
|
+
}
|
|
54332
|
+
if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError("control characters are not allowed in comments", {
|
|
54333
|
+
toml: ctx.s,
|
|
54334
|
+
ptr: ctx.p
|
|
54335
|
+
});
|
|
54336
|
+
}
|
|
54337
|
+
}
|
|
54338
|
+
__name$2(skipComment, "skipComment");
|
|
54339
|
+
function skipVoid(ctx, banNewLines, banComments) {
|
|
54340
|
+
let c$1;
|
|
54341
|
+
while (1) {
|
|
54342
|
+
while ((c$1 = ctx.s.charCodeAt(ctx.p)) === 32 || c$1 === 9 || !banNewLines && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) ctx.p++;
|
|
54343
|
+
if (banComments || c$1 !== 35) break;
|
|
54344
|
+
skipComment(ctx);
|
|
54345
|
+
}
|
|
54346
|
+
}
|
|
54347
|
+
__name$2(skipVoid, "skipVoid");
|
|
54348
|
+
function skipUntil(ctx, sep, end) {
|
|
54349
|
+
let ptr = ctx.p;
|
|
54350
|
+
if (!end) {
|
|
54351
|
+
ptr = indexOfNewline(ctx.s, ptr);
|
|
54352
|
+
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
54353
|
+
return;
|
|
54354
|
+
}
|
|
54355
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
54356
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
54357
|
+
if (c$1 === 35) skipComment(ctx);
|
|
54358
|
+
else if (c$1 === end || c$1 === sep) return;
|
|
54359
|
+
}
|
|
54360
|
+
throw new TomlError("cannot find end of structure", {
|
|
54361
|
+
toml: ctx.s,
|
|
54362
|
+
ptr
|
|
54363
|
+
});
|
|
54364
|
+
}
|
|
54365
|
+
__name$2(skipUntil, "skipUntil");
|
|
54401
54366
|
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
54402
54367
|
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
54403
54368
|
var LEADING_ZERO = /^[+-]?0[0-9_]/;
|
|
54404
|
-
|
|
54405
|
-
|
|
54406
|
-
|
|
54407
|
-
|
|
54408
|
-
|
|
54409
|
-
|
|
54410
|
-
r: "\r",
|
|
54411
|
-
"\"": "\"",
|
|
54412
|
-
"\\": "\\"
|
|
54413
|
-
};
|
|
54414
|
-
function parseString(str, ptr = 0, endPtr = str.length) {
|
|
54415
|
-
let isLiteral = str[ptr] === "'";
|
|
54416
|
-
let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
|
|
54369
|
+
function parseString(ctx) {
|
|
54370
|
+
let start = ctx.p;
|
|
54371
|
+
let c$1 = ctx.s.charCodeAt(ctx.p++);
|
|
54372
|
+
let first = c$1;
|
|
54373
|
+
let isLiteral = c$1 === 39;
|
|
54374
|
+
let isMultiline = c$1 === ctx.s.charCodeAt(ctx.p) && c$1 === ctx.s.charCodeAt(ctx.p + 1);
|
|
54417
54375
|
if (isMultiline) {
|
|
54418
|
-
|
|
54419
|
-
if (
|
|
54420
|
-
if (str[ptr] === "\n") ptr++;
|
|
54376
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p += 2)) === 10) ctx.p++;
|
|
54377
|
+
else if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) ctx.p += 2;
|
|
54421
54378
|
}
|
|
54422
|
-
let tmp = 0;
|
|
54423
|
-
let isEscape;
|
|
54424
54379
|
let parsed = "";
|
|
54425
|
-
let sliceStart =
|
|
54426
|
-
|
|
54427
|
-
|
|
54428
|
-
|
|
54429
|
-
|
|
54430
|
-
|
|
54431
|
-
|
|
54432
|
-
|
|
54433
|
-
}
|
|
54434
|
-
|
|
54435
|
-
|
|
54436
|
-
|
|
54437
|
-
|
|
54438
|
-
|
|
54439
|
-
if (
|
|
54440
|
-
|
|
54441
|
-
|
|
54442
|
-
|
|
54443
|
-
|
|
54444
|
-
|
|
54445
|
-
|
|
54446
|
-
|
|
54447
|
-
|
|
54448
|
-
|
|
54449
|
-
|
|
54450
|
-
|
|
54451
|
-
|
|
54452
|
-
|
|
54453
|
-
|
|
54454
|
-
|
|
54455
|
-
|
|
54456
|
-
toml: str,
|
|
54457
|
-
ptr: tmp
|
|
54380
|
+
let sliceStart = ctx.p;
|
|
54381
|
+
let state = 0;
|
|
54382
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
54383
|
+
c$1 = ctx.s.charCodeAt(ctx.p);
|
|
54384
|
+
if (isMultiline && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) state = state && 3;
|
|
54385
|
+
else if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError("control characters are not allowed in strings", {
|
|
54386
|
+
toml: ctx.s,
|
|
54387
|
+
ptr: ctx.p
|
|
54388
|
+
});
|
|
54389
|
+
else if ((!state || state === 3) && c$1 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
54390
|
+
if (isMultiline) {
|
|
54391
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
54392
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
54393
|
+
}
|
|
54394
|
+
if (!state) parsed += ctx.s.slice(sliceStart, ctx.p);
|
|
54395
|
+
ctx.p += isMultiline ? 3 : 1;
|
|
54396
|
+
return parsed;
|
|
54397
|
+
} else if (!state) {
|
|
54398
|
+
if (!isLiteral && c$1 === 92) {
|
|
54399
|
+
parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
|
|
54400
|
+
state = 1;
|
|
54401
|
+
}
|
|
54402
|
+
} else if (state === 1) if (c$1 === 120 || c$1 === 117 || c$1 === 85) {
|
|
54403
|
+
let value = 0;
|
|
54404
|
+
let len = c$1 === 120 ? 2 : c$1 === 117 ? 4 : 8;
|
|
54405
|
+
for (let j$1 = 0; j$1 < len; j$1++, ctx.p++) {
|
|
54406
|
+
let hex$1 = ctx.s.charCodeAt(ctx.p + 1);
|
|
54407
|
+
let digit = hex$1 >= 48 && hex$1 <= 57 ? hex$1 - 48 : hex$1 >= 65 && hex$1 <= 70 ? hex$1 - 65 + 10 : hex$1 >= 97 && hex$1 <= 102 ? hex$1 - 97 + 10 : -1;
|
|
54408
|
+
if (digit < 0) throw new TomlError("invalid non-hex character in unicode escape", {
|
|
54409
|
+
toml: ctx.s,
|
|
54410
|
+
ptr: ctx.p + 1
|
|
54458
54411
|
});
|
|
54459
|
-
|
|
54460
|
-
}
|
|
54412
|
+
value = value << 4 | digit;
|
|
54413
|
+
}
|
|
54414
|
+
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) throw new TomlError("invalid unicode escape", {
|
|
54415
|
+
toml: ctx.s,
|
|
54416
|
+
ptr: ctx.p
|
|
54417
|
+
});
|
|
54418
|
+
parsed += String.fromCodePoint(value);
|
|
54419
|
+
sliceStart = ctx.p + 1;
|
|
54420
|
+
state = 0;
|
|
54421
|
+
} else if (c$1 === 32 || c$1 === 9) state = 2;
|
|
54422
|
+
else {
|
|
54423
|
+
if (c$1 === 98) parsed += "\b";
|
|
54424
|
+
else if (c$1 === 116) parsed += " ";
|
|
54425
|
+
else if (c$1 === 110) parsed += "\n";
|
|
54426
|
+
else if (c$1 === 102) parsed += "\f";
|
|
54427
|
+
else if (c$1 === 114) parsed += "\r";
|
|
54428
|
+
else if (c$1 === 101) parsed += "\x1B";
|
|
54429
|
+
else if (c$1 === 34) parsed += "\"";
|
|
54430
|
+
else if (c$1 === 92) parsed += "\\";
|
|
54461
54431
|
else throw new TomlError("unrecognized escape sequence", {
|
|
54462
|
-
toml:
|
|
54463
|
-
ptr:
|
|
54432
|
+
toml: ctx.s,
|
|
54433
|
+
ptr: ctx.p
|
|
54434
|
+
});
|
|
54435
|
+
sliceStart = ctx.p + 1;
|
|
54436
|
+
state = 0;
|
|
54437
|
+
}
|
|
54438
|
+
else if (c$1 !== 32 && c$1 !== 9) {
|
|
54439
|
+
if (state === 2) throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
|
|
54440
|
+
toml: ctx.s,
|
|
54441
|
+
ptr: sliceStart
|
|
54464
54442
|
});
|
|
54465
|
-
|
|
54466
|
-
|
|
54467
|
-
tmp = ptr - 1;
|
|
54468
|
-
isEscape = true;
|
|
54469
|
-
parsed += str.slice(sliceStart, tmp);
|
|
54443
|
+
state = !isLiteral && c$1 === 92 ? 1 : 0;
|
|
54444
|
+
sliceStart = ctx.p;
|
|
54470
54445
|
}
|
|
54471
54446
|
}
|
|
54472
|
-
|
|
54447
|
+
throw new TomlError("unfinished string", {
|
|
54448
|
+
toml: ctx.s,
|
|
54449
|
+
ptr: start
|
|
54450
|
+
});
|
|
54473
54451
|
}
|
|
54474
54452
|
__name$2(parseString, "parseString");
|
|
54475
|
-
function
|
|
54476
|
-
|
|
54477
|
-
|
|
54453
|
+
function sliceAndTrimEndOf(ctx, start, end) {
|
|
54454
|
+
let value = ctx.s.slice(start, end);
|
|
54455
|
+
let commentIdx = value.indexOf("#");
|
|
54456
|
+
if (commentIdx > 0) {
|
|
54457
|
+
skipComment({
|
|
54458
|
+
s: value,
|
|
54459
|
+
p: commentIdx
|
|
54460
|
+
});
|
|
54461
|
+
value = value.slice(0, commentIdx);
|
|
54462
|
+
}
|
|
54463
|
+
return value.trimEnd();
|
|
54464
|
+
}
|
|
54465
|
+
__name$2(sliceAndTrimEndOf, "sliceAndTrimEndOf");
|
|
54466
|
+
function parseValue(ctx, integersAsBigInt, end) {
|
|
54467
|
+
let ptr = ctx.p;
|
|
54468
|
+
let err = {
|
|
54469
|
+
toml: ctx.s,
|
|
54470
|
+
ptr
|
|
54471
|
+
};
|
|
54472
|
+
skipUntil(ctx, 44, end);
|
|
54473
|
+
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
|
|
54474
|
+
if (!value) throw new TomlError("incomplete declaration: value expected", err);
|
|
54478
54475
|
if (value === "-inf") return -Infinity;
|
|
54479
54476
|
if (value === "inf" || value === "+inf") return Infinity;
|
|
54480
54477
|
if (value === "nan" || value === "+nan" || value === "-nan") return NaN;
|
|
54481
54478
|
if (value === "-0") return integersAsBigInt ? 0n : 0;
|
|
54482
54479
|
let isInt = INT_REGEX.test(value);
|
|
54483
54480
|
if (isInt || FLOAT_REGEX.test(value)) {
|
|
54484
|
-
if (LEADING_ZERO.test(value)) throw new TomlError("leading zeroes are not allowed",
|
|
54485
|
-
toml,
|
|
54486
|
-
ptr
|
|
54487
|
-
});
|
|
54481
|
+
if (LEADING_ZERO.test(value)) throw new TomlError("leading zeroes are not allowed", err);
|
|
54488
54482
|
value = value.replace(/_/g, "");
|
|
54489
54483
|
let numeric$1 = +value;
|
|
54490
|
-
if (isNaN(numeric$1)) throw new TomlError("invalid number",
|
|
54491
|
-
toml,
|
|
54492
|
-
ptr
|
|
54493
|
-
});
|
|
54484
|
+
if (isNaN(numeric$1)) throw new TomlError("invalid number", err);
|
|
54494
54485
|
if (isInt) {
|
|
54495
|
-
if ((isInt = !Number.isSafeInteger(numeric$1)) && !integersAsBigInt) throw new TomlError("integer value cannot be represented losslessly",
|
|
54496
|
-
toml,
|
|
54497
|
-
ptr
|
|
54498
|
-
});
|
|
54486
|
+
if ((isInt = !Number.isSafeInteger(numeric$1)) && !integersAsBigInt) throw new TomlError("integer value cannot be represented losslessly", err);
|
|
54499
54487
|
if (isInt || integersAsBigInt === true) numeric$1 = BigInt(value);
|
|
54500
54488
|
}
|
|
54501
54489
|
return numeric$1;
|
|
54502
54490
|
}
|
|
54503
54491
|
const date$1 = new TomlDate(value);
|
|
54504
|
-
if (!date$1.isValid()) throw new TomlError("invalid value",
|
|
54505
|
-
toml,
|
|
54506
|
-
ptr
|
|
54507
|
-
});
|
|
54492
|
+
if (!date$1.isValid()) throw new TomlError("invalid value", err);
|
|
54508
54493
|
return date$1;
|
|
54509
54494
|
}
|
|
54510
54495
|
__name$2(parseValue, "parseValue");
|
|
54511
|
-
function
|
|
54512
|
-
let
|
|
54513
|
-
let
|
|
54514
|
-
if (
|
|
54515
|
-
|
|
54516
|
-
|
|
54517
|
-
|
|
54518
|
-
let trimmed = value.trimEnd();
|
|
54519
|
-
if (!allowNewLines) {
|
|
54520
|
-
let newlineIdx = value.indexOf("\n", trimmed.length);
|
|
54521
|
-
if (newlineIdx > -1) throw new TomlError("newlines are not allowed in inline tables", {
|
|
54522
|
-
toml: str,
|
|
54523
|
-
ptr: startPtr + newlineIdx
|
|
54496
|
+
function extractValue(ctx, end, integersAsBigInt) {
|
|
54497
|
+
let ptr = ctx.p;
|
|
54498
|
+
let c$1 = ctx.s.charCodeAt(ptr);
|
|
54499
|
+
if (c$1 === 91 || c$1 === 123) {
|
|
54500
|
+
if (!ctx.d--) throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
54501
|
+
toml: ctx.s,
|
|
54502
|
+
ptr
|
|
54524
54503
|
});
|
|
54504
|
+
let value = c$1 === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
|
|
54505
|
+
ctx.d++;
|
|
54506
|
+
return value;
|
|
54525
54507
|
}
|
|
54526
|
-
return
|
|
54527
|
-
|
|
54528
|
-
|
|
54529
|
-
|
|
54530
|
-
|
|
54531
|
-
|
|
54532
|
-
|
|
54533
|
-
|
|
54534
|
-
let c$1 = str[ptr];
|
|
54535
|
-
if (c$1 === "[" || c$1 === "{") {
|
|
54536
|
-
let [value, endPtr2] = c$1 === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
|
|
54537
|
-
let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2;
|
|
54538
|
-
if (endPtr2 - newPtr && end === "}") {
|
|
54539
|
-
let nextNewLine = indexOfNewline(str, endPtr2, newPtr);
|
|
54540
|
-
if (nextNewLine > -1) throw new TomlError("newlines are not allowed in inline tables", {
|
|
54541
|
-
toml: str,
|
|
54542
|
-
ptr: nextNewLine
|
|
54543
|
-
});
|
|
54544
|
-
}
|
|
54545
|
-
return [value, newPtr];
|
|
54546
|
-
}
|
|
54547
|
-
let endPtr;
|
|
54548
|
-
if (c$1 === "\"" || c$1 === "'") {
|
|
54549
|
-
endPtr = getStringEnd(str, ptr);
|
|
54550
|
-
let parsed = parseString(str, ptr, endPtr);
|
|
54551
|
-
if (end) {
|
|
54552
|
-
endPtr = skipVoid(str, endPtr, end !== "]");
|
|
54553
|
-
if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") throw new TomlError("unexpected character encountered", {
|
|
54554
|
-
toml: str,
|
|
54555
|
-
ptr: endPtr
|
|
54556
|
-
});
|
|
54557
|
-
endPtr += +(str[endPtr] === ",");
|
|
54558
|
-
}
|
|
54559
|
-
return [parsed, endPtr];
|
|
54508
|
+
if (c$1 === 34 || c$1 === 39) return parseString(ctx);
|
|
54509
|
+
if (c$1 === 116) {
|
|
54510
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError("invalid value", {
|
|
54511
|
+
toml: ctx.s,
|
|
54512
|
+
ptr
|
|
54513
|
+
});
|
|
54514
|
+
ctx.p++;
|
|
54515
|
+
return true;
|
|
54560
54516
|
}
|
|
54561
|
-
|
|
54562
|
-
|
|
54563
|
-
|
|
54564
|
-
|
|
54565
|
-
|
|
54566
|
-
|
|
54567
|
-
|
|
54568
|
-
endPtr = skipVoid(str, ptr + slice[1]);
|
|
54569
|
-
endPtr += +(str[endPtr] === ",");
|
|
54517
|
+
if (c$1 === 102) {
|
|
54518
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError("invalid value", {
|
|
54519
|
+
toml: ctx.s,
|
|
54520
|
+
ptr
|
|
54521
|
+
});
|
|
54522
|
+
ctx.p++;
|
|
54523
|
+
return false;
|
|
54570
54524
|
}
|
|
54571
|
-
return
|
|
54525
|
+
return parseValue(ctx, integersAsBigInt, end);
|
|
54572
54526
|
}
|
|
54573
54527
|
__name$2(extractValue, "extractValue");
|
|
54574
54528
|
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
54575
|
-
function parseKey(
|
|
54576
|
-
let
|
|
54529
|
+
function parseKey(ctx, end = "=") {
|
|
54530
|
+
let start = ctx.p;
|
|
54531
|
+
let dot = start - 1;
|
|
54577
54532
|
let parsed = [];
|
|
54578
|
-
let endPtr =
|
|
54533
|
+
let endPtr = ctx.s.indexOf(end, start);
|
|
54579
54534
|
if (endPtr < 0) throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
54580
|
-
toml:
|
|
54581
|
-
ptr
|
|
54535
|
+
toml: ctx.s,
|
|
54536
|
+
ptr: start
|
|
54582
54537
|
});
|
|
54583
54538
|
do {
|
|
54584
|
-
let c$1 =
|
|
54585
|
-
if (c$1 !==
|
|
54586
|
-
if (c$1 ===
|
|
54587
|
-
toml:
|
|
54588
|
-
ptr
|
|
54589
|
-
});
|
|
54590
|
-
let
|
|
54591
|
-
|
|
54592
|
-
|
|
54593
|
-
ptr
|
|
54594
|
-
});
|
|
54595
|
-
dot = str.indexOf(".", eos);
|
|
54596
|
-
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
54539
|
+
let c$1 = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
54540
|
+
if (c$1 !== 32 && c$1 !== 9) if (c$1 === 34 || c$1 === 39) {
|
|
54541
|
+
if (c$1 === ctx.s.charCodeAt(ctx.p + 1) && c$1 === ctx.s.charCodeAt(ctx.p + 2)) throw new TomlError("multiline strings are not allowed in keys", {
|
|
54542
|
+
toml: ctx.s,
|
|
54543
|
+
ptr: ctx.p
|
|
54544
|
+
});
|
|
54545
|
+
let part = parseString(ctx);
|
|
54546
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
54547
|
+
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
54597
54548
|
let newLine = indexOfNewline(strEnd);
|
|
54598
54549
|
if (newLine > -1) throw new TomlError("newlines are not allowed in keys", {
|
|
54599
|
-
toml:
|
|
54600
|
-
ptr:
|
|
54550
|
+
toml: ctx.s,
|
|
54551
|
+
ptr: newLine
|
|
54601
54552
|
});
|
|
54602
54553
|
if (strEnd.trimStart()) throw new TomlError("found extra tokens after the string part", {
|
|
54603
|
-
toml:
|
|
54604
|
-
ptr:
|
|
54554
|
+
toml: ctx.s,
|
|
54555
|
+
ptr: ctx.p
|
|
54605
54556
|
});
|
|
54606
|
-
if (endPtr <
|
|
54607
|
-
endPtr =
|
|
54557
|
+
if (endPtr < ctx.p) {
|
|
54558
|
+
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
54608
54559
|
if (endPtr < 0) throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
54609
|
-
toml:
|
|
54610
|
-
ptr
|
|
54560
|
+
toml: ctx.s,
|
|
54561
|
+
ptr: start
|
|
54611
54562
|
});
|
|
54612
54563
|
}
|
|
54613
|
-
parsed.push(
|
|
54564
|
+
parsed.push(part);
|
|
54614
54565
|
} else {
|
|
54615
|
-
dot =
|
|
54616
|
-
let part =
|
|
54566
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
54567
|
+
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
54617
54568
|
if (!KEY_PART_RE.test(part)) throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
54618
|
-
toml:
|
|
54619
|
-
ptr
|
|
54569
|
+
toml: ctx.s,
|
|
54570
|
+
ptr: ctx.p
|
|
54620
54571
|
});
|
|
54621
54572
|
parsed.push(part.trimEnd());
|
|
54622
54573
|
}
|
|
54623
54574
|
} while (dot + 1 && dot < endPtr);
|
|
54624
|
-
|
|
54575
|
+
ctx.p = endPtr + 1;
|
|
54576
|
+
skipVoid(ctx, true, true);
|
|
54577
|
+
return parsed;
|
|
54625
54578
|
}
|
|
54626
54579
|
__name$2(parseKey, "parseKey");
|
|
54627
|
-
function parseInlineTable(
|
|
54580
|
+
function parseInlineTable(ctx, integersAsBigInt) {
|
|
54628
54581
|
let res = {};
|
|
54629
54582
|
let seen = /* @__PURE__ */ new Set();
|
|
54630
54583
|
let c$1;
|
|
54631
|
-
|
|
54632
|
-
|
|
54633
|
-
|
|
54634
|
-
|
|
54635
|
-
|
|
54636
|
-
|
|
54637
|
-
}
|
|
54638
|
-
|
|
54639
|
-
|
|
54640
|
-
|
|
54641
|
-
|
|
54642
|
-
|
|
54643
|
-
|
|
54644
|
-
|
|
54645
|
-
|
|
54646
|
-
|
|
54647
|
-
|
|
54648
|
-
|
|
54649
|
-
|
|
54650
|
-
|
|
54651
|
-
|
|
54652
|
-
|
|
54653
|
-
|
|
54654
|
-
enumerable: true,
|
|
54655
|
-
configurable: true,
|
|
54656
|
-
writable: true
|
|
54657
|
-
});
|
|
54658
|
-
}
|
|
54659
|
-
if (hasOwn) throw new TomlError("trying to redefine an already defined value", {
|
|
54660
|
-
toml: str,
|
|
54661
|
-
ptr
|
|
54584
|
+
ctx.p++;
|
|
54585
|
+
while (ctx.p < ctx.s.length) {
|
|
54586
|
+
skipVoid(ctx);
|
|
54587
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
54588
|
+
ctx.p++;
|
|
54589
|
+
return res;
|
|
54590
|
+
}
|
|
54591
|
+
let k;
|
|
54592
|
+
let t$4 = res;
|
|
54593
|
+
let hasOwn = false;
|
|
54594
|
+
let p$1 = ctx.p;
|
|
54595
|
+
let key = parseKey(ctx);
|
|
54596
|
+
for (let i = 0; i < key.length; i++) {
|
|
54597
|
+
if (i) t$4 = hasOwn ? t$4[k] : t$4[k] = {};
|
|
54598
|
+
k = key[i];
|
|
54599
|
+
if ((hasOwn = Object.hasOwn(t$4, k)) && (typeof t$4[k] !== "object" || seen.has(t$4[k]))) throw new TomlError("trying to redefine an already defined value", {
|
|
54600
|
+
toml: ctx.s,
|
|
54601
|
+
ptr: p$1
|
|
54602
|
+
});
|
|
54603
|
+
if (!hasOwn && k === "__proto__") Object.defineProperty(t$4, k, {
|
|
54604
|
+
enumerable: true,
|
|
54605
|
+
configurable: true,
|
|
54606
|
+
writable: true
|
|
54662
54607
|
});
|
|
54663
|
-
let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
|
|
54664
|
-
seen.add(value);
|
|
54665
|
-
t$4[k] = value;
|
|
54666
|
-
ptr = valueEndPtr;
|
|
54667
|
-
comma = str[ptr - 1] === "," ? ptr - 1 : 0;
|
|
54668
54608
|
}
|
|
54609
|
+
if (hasOwn) throw new TomlError("trying to redefine an already defined value", {
|
|
54610
|
+
toml: ctx.s,
|
|
54611
|
+
ptr: ctx.p
|
|
54612
|
+
});
|
|
54613
|
+
let value = extractValue(ctx, 125, integersAsBigInt);
|
|
54614
|
+
seen.add(t$4[k] = value);
|
|
54615
|
+
skipVoid(ctx);
|
|
54616
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 125) return res;
|
|
54617
|
+
if (c$1 !== 44) throw new TomlError("expected comma or end of structure", {
|
|
54618
|
+
toml: ctx.s,
|
|
54619
|
+
ptr: ctx.p - 1
|
|
54620
|
+
});
|
|
54669
54621
|
}
|
|
54670
|
-
|
|
54671
|
-
toml:
|
|
54672
|
-
ptr:
|
|
54673
|
-
});
|
|
54674
|
-
if (!c$1) throw new TomlError("unfinished table encountered", {
|
|
54675
|
-
toml: str,
|
|
54676
|
-
ptr
|
|
54622
|
+
throw new TomlError("unfinished table encountered", {
|
|
54623
|
+
toml: ctx.s,
|
|
54624
|
+
ptr: ctx.p
|
|
54677
54625
|
});
|
|
54678
|
-
return [res, ptr];
|
|
54679
54626
|
}
|
|
54680
54627
|
__name$2(parseInlineTable, "parseInlineTable");
|
|
54681
|
-
function parseArray(
|
|
54628
|
+
function parseArray(ctx, integersAsBigInt) {
|
|
54682
54629
|
let res = [];
|
|
54683
54630
|
let c$1;
|
|
54684
|
-
|
|
54685
|
-
while (
|
|
54686
|
-
|
|
54687
|
-
|
|
54688
|
-
|
|
54689
|
-
|
|
54690
|
-
|
|
54691
|
-
|
|
54692
|
-
|
|
54693
|
-
|
|
54694
|
-
|
|
54695
|
-
|
|
54696
|
-
|
|
54697
|
-
|
|
54631
|
+
ctx.p++;
|
|
54632
|
+
while (ctx.p < ctx.s.length) {
|
|
54633
|
+
skipVoid(ctx);
|
|
54634
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
54635
|
+
ctx.p++;
|
|
54636
|
+
return res;
|
|
54637
|
+
}
|
|
54638
|
+
res.push(extractValue(ctx, 93, integersAsBigInt));
|
|
54639
|
+
skipVoid(ctx);
|
|
54640
|
+
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 93) return res;
|
|
54641
|
+
if (c$1 !== 44) throw new TomlError("expected comma or end of structure", {
|
|
54642
|
+
toml: ctx.s,
|
|
54643
|
+
ptr: ctx.p - 1
|
|
54644
|
+
});
|
|
54645
|
+
}
|
|
54646
|
+
throw new TomlError("unfinished array encountered", {
|
|
54647
|
+
toml: ctx.s,
|
|
54648
|
+
ptr: ctx.p
|
|
54698
54649
|
});
|
|
54699
|
-
return [res, ptr];
|
|
54700
54650
|
}
|
|
54701
54651
|
__name$2(parseArray, "parseArray");
|
|
54702
54652
|
function peekTable(key, table, meta$1, type) {
|
|
@@ -54766,46 +54716,51 @@ function peekTable(key, table, meta$1, type) {
|
|
|
54766
54716
|
}
|
|
54767
54717
|
__name$2(peekTable, "peekTable");
|
|
54768
54718
|
function parse$3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
54719
|
+
let ctx = {
|
|
54720
|
+
s: toml,
|
|
54721
|
+
p: 0,
|
|
54722
|
+
d: maxDepth
|
|
54723
|
+
};
|
|
54769
54724
|
let res = {};
|
|
54770
54725
|
let meta$1 = {};
|
|
54726
|
+
let tmp;
|
|
54771
54727
|
let tbl = res;
|
|
54772
54728
|
let m = meta$1;
|
|
54773
|
-
|
|
54774
|
-
|
|
54775
|
-
|
|
54776
|
-
let
|
|
54729
|
+
skipVoid(ctx);
|
|
54730
|
+
while (ctx.p < toml.length) {
|
|
54731
|
+
if (toml.charCodeAt(ctx.p) === 91) {
|
|
54732
|
+
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
54733
|
+
tmp = ctx.p += +isTableArray;
|
|
54734
|
+
let k = parseKey(ctx, "]");
|
|
54777
54735
|
if (isTableArray) {
|
|
54778
|
-
if (toml
|
|
54736
|
+
if (toml.charCodeAt(ctx.p - 1) !== 93) throw new TomlError("expected end of table declaration", {
|
|
54779
54737
|
toml,
|
|
54780
|
-
ptr:
|
|
54738
|
+
ptr: ctx.p - 1
|
|
54781
54739
|
});
|
|
54782
|
-
|
|
54740
|
+
ctx.p++;
|
|
54783
54741
|
}
|
|
54784
|
-
let p$1 = peekTable(k
|
|
54742
|
+
let p$1 = peekTable(k, res, meta$1, isTableArray ? 2 : 1);
|
|
54785
54743
|
if (!p$1) throw new TomlError("trying to redefine an already defined table or value", {
|
|
54786
54744
|
toml,
|
|
54787
|
-
ptr
|
|
54745
|
+
ptr: tmp
|
|
54788
54746
|
});
|
|
54789
54747
|
m = p$1[2];
|
|
54790
54748
|
tbl = p$1[1];
|
|
54791
|
-
ptr = k[1];
|
|
54792
54749
|
} else {
|
|
54793
|
-
|
|
54794
|
-
let p$1 = peekTable(
|
|
54750
|
+
tmp = ctx.p;
|
|
54751
|
+
let p$1 = peekTable(parseKey(ctx), tbl, m, 0);
|
|
54795
54752
|
if (!p$1) throw new TomlError("trying to redefine an already defined table or value", {
|
|
54796
54753
|
toml,
|
|
54797
|
-
ptr
|
|
54754
|
+
ptr: tmp
|
|
54798
54755
|
});
|
|
54799
|
-
|
|
54800
|
-
p$1[1][p$1[0]] = v[0];
|
|
54801
|
-
ptr = v[1];
|
|
54756
|
+
p$1[1][p$1[0]] = extractValue(ctx, void 0, integersAsBigInt);
|
|
54802
54757
|
}
|
|
54803
|
-
|
|
54804
|
-
if (toml
|
|
54758
|
+
skipVoid(ctx, true);
|
|
54759
|
+
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) throw new TomlError("each key-value declaration must be followed by an end-of-line", {
|
|
54805
54760
|
toml,
|
|
54806
|
-
ptr
|
|
54761
|
+
ptr: ctx.p
|
|
54807
54762
|
});
|
|
54808
|
-
|
|
54763
|
+
skipVoid(ctx);
|
|
54809
54764
|
}
|
|
54810
54765
|
return res;
|
|
54811
54766
|
}
|
|
@@ -54815,7 +54770,8 @@ function extendedTypeOf(obj) {
|
|
|
54815
54770
|
let type = typeof obj;
|
|
54816
54771
|
if (type === "object") {
|
|
54817
54772
|
if (Array.isArray(obj)) return "array";
|
|
54818
|
-
if (obj instanceof Date) return "date";
|
|
54773
|
+
if (typeof obj?.getUTCDate === "function" && obj instanceof Date) return "date";
|
|
54774
|
+
if (globalThis.Temporal && typeof obj?.since === "function" && (obj instanceof Temporal.Instant || obj instanceof Temporal.PlainDate || obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainTime || obj instanceof Temporal.ZonedDateTime)) return "temporal";
|
|
54819
54775
|
}
|
|
54820
54776
|
return type;
|
|
54821
54777
|
}
|
|
@@ -54829,23 +54785,31 @@ function formatString(s) {
|
|
|
54829
54785
|
return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
|
|
54830
54786
|
}
|
|
54831
54787
|
__name$2(formatString, "formatString");
|
|
54788
|
+
function stringifyTemporal(temporal) {
|
|
54789
|
+
return temporal.toString({
|
|
54790
|
+
calendarName: "never",
|
|
54791
|
+
timeZoneName: "never"
|
|
54792
|
+
});
|
|
54793
|
+
}
|
|
54794
|
+
__name$2(stringifyTemporal, "stringifyTemporal");
|
|
54832
54795
|
function stringifyValue(val, type, depth, numberAsFloat) {
|
|
54833
54796
|
if (depth === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
54834
|
-
|
|
54835
|
-
|
|
54836
|
-
|
|
54837
|
-
|
|
54838
|
-
|
|
54839
|
-
|
|
54840
|
-
|
|
54841
|
-
|
|
54842
|
-
|
|
54843
|
-
|
|
54844
|
-
|
|
54845
|
-
|
|
54846
|
-
|
|
54847
|
-
|
|
54848
|
-
|
|
54797
|
+
switch (type) {
|
|
54798
|
+
case "number":
|
|
54799
|
+
if (isNaN(val)) return "nan";
|
|
54800
|
+
if (val === Infinity) return "inf";
|
|
54801
|
+
if (val === -Infinity) return "-inf";
|
|
54802
|
+
if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val))) return val.toFixed(1);
|
|
54803
|
+
case "bigint":
|
|
54804
|
+
case "boolean": return val.toString();
|
|
54805
|
+
case "string": return formatString(val);
|
|
54806
|
+
case "date":
|
|
54807
|
+
if (isNaN(val.getTime())) throw new TypeError("cannot serialize invalid date");
|
|
54808
|
+
return val.toISOString();
|
|
54809
|
+
case "object": return stringifyInlineTable(val, depth, numberAsFloat);
|
|
54810
|
+
case "array": return stringifyArray(val, depth, numberAsFloat);
|
|
54811
|
+
case "temporal": return stringifyTemporal(val);
|
|
54812
|
+
}
|
|
54849
54813
|
}
|
|
54850
54814
|
__name$2(stringifyValue, "stringifyValue");
|
|
54851
54815
|
function stringifyInlineTable(obj, depth, numberAsFloat) {
|
|
@@ -55674,7 +55638,7 @@ function scrubEncryptedCredentials(options) {
|
|
|
55674
55638
|
__name$2(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
55675
55639
|
|
|
55676
55640
|
//#endregion
|
|
55677
|
-
//#region ../workers-auth/dist/chunk-
|
|
55641
|
+
//#region ../workers-auth/dist/chunk-A6F4WXCF.mjs
|
|
55678
55642
|
function createPreferences(getConfigPath) {
|
|
55679
55643
|
function getUserPreferencesPath() {
|
|
55680
55644
|
return path.resolve(getConfigPath(), "preferences.json");
|
|
@@ -56828,7 +56792,7 @@ function getCfConfigPath() {
|
|
|
56828
56792
|
});
|
|
56829
56793
|
}
|
|
56830
56794
|
__name$2(getCfConfigPath, "getCfConfigPath");
|
|
56831
|
-
var
|
|
56795
|
+
var CF_CLIENT_REGISTERED_SCOPES = [
|
|
56832
56796
|
"access:read",
|
|
56833
56797
|
"access:write",
|
|
56834
56798
|
"account:read",
|
|
@@ -57304,102 +57268,21 @@ var CF_REGISTERED_SCOPES = [
|
|
|
57304
57268
|
"zone.read",
|
|
57305
57269
|
"zone.write"
|
|
57306
57270
|
];
|
|
57307
|
-
var
|
|
57308
|
-
"
|
|
57309
|
-
"
|
|
57310
|
-
"
|
|
57311
|
-
"
|
|
57312
|
-
"
|
|
57313
|
-
"
|
|
57314
|
-
|
|
57315
|
-
|
|
57316
|
-
|
|
57317
|
-
"ai:read",
|
|
57318
|
-
"ai:write",
|
|
57319
|
-
"ai-search:read",
|
|
57320
|
-
"ai-search:run",
|
|
57321
|
-
"ai-search:write",
|
|
57322
|
-
"aiaudit:read",
|
|
57323
|
-
"aiaudit:write",
|
|
57324
|
-
"aig:read",
|
|
57325
|
-
"aig:write",
|
|
57326
|
-
"auditlogs:read",
|
|
57327
|
-
"browser:read",
|
|
57328
|
-
"browser:write",
|
|
57329
|
-
"cfone:read",
|
|
57330
|
-
"cfone:write",
|
|
57331
|
-
"cloudchamber:write",
|
|
57332
|
-
"connectivity:admin",
|
|
57333
|
-
"connectivity:bind",
|
|
57334
|
-
"connectivity:read",
|
|
57335
|
-
"constellation:write",
|
|
57336
|
-
"containers:write",
|
|
57337
|
-
"d1:write",
|
|
57338
|
-
"dex:read",
|
|
57339
|
-
"dex:write",
|
|
57340
|
-
"dns_analytics:read",
|
|
57341
|
-
"dns_records:edit",
|
|
57342
|
-
"dns_records:read",
|
|
57343
|
-
"dns_settings:read",
|
|
57344
|
-
"email_routing:write",
|
|
57345
|
-
"email_sending:write",
|
|
57346
|
-
"firstpartytags:write",
|
|
57347
|
-
"images:read",
|
|
57348
|
-
"images:write",
|
|
57349
|
-
"lb:edit",
|
|
57350
|
-
"lb:read",
|
|
57351
|
-
"logpush:read",
|
|
57352
|
-
"logpush:write",
|
|
57353
|
-
"mcp_portals:read",
|
|
57354
|
-
"mcp_portals:write",
|
|
57355
|
-
"notebook-examples:read",
|
|
57356
|
-
"notification:read",
|
|
57357
|
-
"notification:write",
|
|
57358
|
-
"pages:read",
|
|
57359
|
-
"pages:write",
|
|
57360
|
-
"pipelines:read",
|
|
57361
|
-
"pipelines:setup",
|
|
57362
|
-
"pipelines:write",
|
|
57363
|
-
"query_cache:write",
|
|
57364
|
-
"queues:write",
|
|
57365
|
-
"r2_catalog:write",
|
|
57366
|
-
"radar:read",
|
|
57367
|
-
"rag:read",
|
|
57368
|
-
"rag:write",
|
|
57369
|
-
"registrar:read",
|
|
57370
|
-
"registrar:write",
|
|
57371
|
-
"secrets_store:read",
|
|
57372
|
-
"secrets_store:write",
|
|
57373
|
-
"sso-connector:read",
|
|
57374
|
-
"sso-connector:write",
|
|
57375
|
-
"ssl_certs:write",
|
|
57376
|
-
"tag.write",
|
|
57377
|
-
"teams:pii",
|
|
57378
|
-
"teams:read",
|
|
57379
|
-
"teams:secure_location",
|
|
57380
|
-
"teams:write",
|
|
57381
|
-
"url_scanner:read",
|
|
57382
|
-
"url_scanner:write",
|
|
57383
|
-
"vectorize:write",
|
|
57384
|
-
"workers:read",
|
|
57385
|
-
"workers:write",
|
|
57386
|
-
"workers_builds:read",
|
|
57387
|
-
"workers_builds:write",
|
|
57388
|
-
"workers_deployments:read",
|
|
57389
|
-
"workers_kv:write",
|
|
57390
|
-
"workers_observability:read",
|
|
57391
|
-
"workers_observability:write",
|
|
57392
|
-
"workers_observability_telemetry:write",
|
|
57393
|
-
"workers_routes:write",
|
|
57394
|
-
"workers_scripts:write",
|
|
57395
|
-
"workers_tail:read",
|
|
57396
|
-
"zone:read"
|
|
57397
|
-
]];
|
|
57271
|
+
var CF_UNGRANTABLE_SCOPE_SET = new Set([
|
|
57272
|
+
"billing:read",
|
|
57273
|
+
"billing:write",
|
|
57274
|
+
"email_routing:read",
|
|
57275
|
+
"email_sending:read",
|
|
57276
|
+
"notebook-managed:read",
|
|
57277
|
+
"oauth_account_ssl_and_certificates_write"
|
|
57278
|
+
]);
|
|
57279
|
+
var CF_REQUESTABLE_SCOPES = CF_CLIENT_REGISTERED_SCOPES.filter((scope) => !CF_UNGRANTABLE_SCOPE_SET.has(scope));
|
|
57280
|
+
var DefaultScopeKeys$1 = [...CF_REQUESTABLE_SCOPES];
|
|
57398
57281
|
function setLoginScopeKeys$1(scopes) {
|
|
57399
57282
|
DefaultScopeKeys$1 = scopes;
|
|
57400
57283
|
}
|
|
57401
57284
|
__name$2(setLoginScopeKeys$1, "setLoginScopeKeys");
|
|
57402
|
-
var CF_SCOPE_SET = new Set(
|
|
57285
|
+
var CF_SCOPE_SET = new Set(CF_REQUESTABLE_SCOPES);
|
|
57403
57286
|
function validateScopeKeys$1(scopes) {
|
|
57404
57287
|
return scopes.every((scope) => CF_SCOPE_SET.has(scope));
|
|
57405
57288
|
}
|
|
@@ -61851,7 +61734,7 @@ __name$1(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
61851
61734
|
//#endregion
|
|
61852
61735
|
//#region ../remote-bindings/dist/index.mjs
|
|
61853
61736
|
var import_undici = require_undici();
|
|
61854
|
-
var version = "0.0.
|
|
61737
|
+
var version = "0.0.31";
|
|
61855
61738
|
var NoDefaultValueProvided = class extends UserError$1 {
|
|
61856
61739
|
constructor() {
|
|
61857
61740
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|