Bump smol-toml from 1.6.1 to 1.7.0 (#474)

b153028 · dependabot[bot] · 2026-06-29 22:19

3 files +322 -285
Message
{commit_body(@commit)}

Files changed

modified dist/index.js
+304 −280
@@ -36511,184 +36511,6 @@ const parse = function (data, opts = {}) {
36511 36511
36512 36512
36513 36513
36514 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/error.js
36515 /*!
36516 * Copyright (c) Squirrel Chat et al., All rights reserved.
36517 * SPDX-License-Identifier: BSD-3-Clause
36518 *
36519 * Redistribution and use in source and binary forms, with or without
36520 * modification, are permitted provided that the following conditions are met:
36521 *
36522 * 1. Redistributions of source code must retain the above copyright notice, this
36523 * list of conditions and the following disclaimer.
36524 * 2. Redistributions in binary form must reproduce the above copyright notice,
36525 * this list of conditions and the following disclaimer in the
36526 * documentation and/or other materials provided with the distribution.
36527 * 3. Neither the name of the copyright holder nor the names of its contributors
36528 * may be used to endorse or promote products derived from this software without
36529 * specific prior written permission.
36530 *
36531 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
36532 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36533 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36534 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36535 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36536 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36537 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36538 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36539 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36540 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36541 */
36542 function getLineColFromPtr(string, ptr) {
36543 let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
36544 return [lines.length, lines.pop().length + 1];
36545 }
36546 function makeCodeBlock(string, line, column) {
36547 let lines = string.split(/\r\n|\n|\r/g);
36548 let codeblock = '';
36549 let numberLen = (Math.log10(line + 1) | 0) + 1;
36550 for (let i = line - 1; i <= line + 1; i++) {
36551 let l = lines[i - 1];
36552 if (!l)
36553 continue;
36554 codeblock += i.toString().padEnd(numberLen, ' ');
36555 codeblock += ': ';
36556 codeblock += l;
36557 codeblock += '\n';
36558 if (i === line) {
36559 codeblock += ' '.repeat(numberLen + column + 2);
36560 codeblock += '^\n';
36561 }
36562 }
36563 return codeblock;
36564 }
36565 class TomlError extends Error {
36566 line;
36567 column;
36568 codeblock;
36569 constructor(message, options) {
36570 const [line, column] = getLineColFromPtr(options.toml, options.ptr);
36571 const codeblock = makeCodeBlock(options.toml, line, column);
36572 super(`Invalid TOML document: ${message}\n\n${codeblock}`, options);
36573 this.line = line;
36574 this.column = column;
36575 this.codeblock = codeblock;
36576 }
36577 }
36578
36579 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/util.js
36580 /*!
36581 * Copyright (c) Squirrel Chat et al., All rights reserved.
36582 * SPDX-License-Identifier: BSD-3-Clause
36583 *
36584 * Redistribution and use in source and binary forms, with or without
36585 * modification, are permitted provided that the following conditions are met:
36586 *
36587 * 1. Redistributions of source code must retain the above copyright notice, this
36588 * list of conditions and the following disclaimer.
36589 * 2. Redistributions in binary form must reproduce the above copyright notice,
36590 * this list of conditions and the following disclaimer in the
36591 * documentation and/or other materials provided with the distribution.
36592 * 3. Neither the name of the copyright holder nor the names of its contributors
36593 * may be used to endorse or promote products derived from this software without
36594 * specific prior written permission.
36595 *
36596 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
36597 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36598 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36599 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36600 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36601 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36602 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36603 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36604 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36605 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36606 */
36607
36608 function isEscaped(str, ptr) {
36609 let i = 0;
36610 while (str[ptr - ++i] === '\\')
36611 ;
36612 return --i && (i % 2);
36613 }
36614 function indexOfNewline(str, start = 0, end = str.length) {
36615 let idx = str.indexOf('\n', start);
36616 if (str[idx - 1] === '\r')
36617 idx--;
36618 return idx <= end ? idx : -1;
36619 }
36620 function skipComment(str, ptr) {
36621 for (let i = ptr; i < str.length; i++) {
36622 let c = str[i];
36623 if (c === '\n')
36624 return i;
36625 if (c === '\r' && str[i + 1] === '\n')
36626 return i + 1;
36627 if ((c < '\x20' && c !== '\t') || c === '\x7f') {
36628 throw new TomlError('control characters are not allowed in comments', {
36629 toml: str,
36630 ptr: ptr,
36631 });
36632 }
36633 }
36634 return str.length;
36635 }
36636 function skipVoid(str, ptr, banNewLines, banComments) {
36637 let c;
36638 while (1) {
36639 while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r' && str[ptr + 1] === '\n')))
36640 ptr++;
36641 // Tucking the return statement here would save 5 characters >:)
36642 // But TypeScript fails to detect there is no way to exit the loop so it complains about the lack of final return
36643 if (banComments || c !== '#')
36644 break;
36645 ptr = skipComment(str, ptr);
36646 }
36647 return ptr;
36648 }
36649 function skipUntil(str, ptr, sep, end, banNewLines = false) {
36650 if (!end) {
36651 ptr = indexOfNewline(str, ptr);
36652 return ptr < 0 ? str.length : ptr;
36653 }
36654 for (let i = ptr; i < str.length; i++) {
36655 let c = str[i];
36656 if (c === '#') {
36657 i = indexOfNewline(str, i);
36658 }
36659 else if (c === sep) {
36660 return i + 1;
36661 }
36662 else if (c === end || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
36663 return i;
36664 }
36665 }
36666 throw new TomlError('cannot find end of structure', {
36667 toml: str,
36668 ptr: ptr
36669 });
36670 }
36671 function getStringEnd(str, seek) {
36672 let first = str[seek];
36673 let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2]
36674 ? str.slice(seek, seek + 3)
36675 : first;
36676 seek += target.length - 1;
36677 do
36678 seek = str.indexOf(target, ++seek);
36679 while (seek > -1 && first !== "'" && isEscaped(str, seek));
36680 if (seek > -1) {
36681 seek += target.length;
36682 if (target.length > 1) {
36683 if (str[seek] === first)
36684 seek++;
36685 if (str[seek] === first)
36686 seek++;
36687 }
36688 }
36689 return seek;
36690 }
36691
36692 36514 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/date.js
36693 36515 /*!
36694 36516 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -36817,7 +36639,72 @@ class TomlDate extends Date {
36817 36639 return date;
36818 36640 }
36819 36641 }
36820
36642 +//# sourceMappingURL=date.js.map
36643 +;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/error.js
36644 +/*!
36645 + * Copyright (c) Squirrel Chat et al., All rights reserved.
36646 + * SPDX-License-Identifier: BSD-3-Clause
36647 + *
36648 + * Redistribution and use in source and binary forms, with or without
36649 + * modification, are permitted provided that the following conditions are met:
36650 + *
36651 + * 1. Redistributions of source code must retain the above copyright notice, this
36652 + * list of conditions and the following disclaimer.
36653 + * 2. Redistributions in binary form must reproduce the above copyright notice,
36654 + * this list of conditions and the following disclaimer in the
36655 + * documentation and/or other materials provided with the distribution.
36656 + * 3. Neither the name of the copyright holder nor the names of its contributors
36657 + * may be used to endorse or promote products derived from this software without
36658 + * specific prior written permission.
36659 + *
36660 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
36661 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36662 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36663 + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36664 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36665 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36666 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36667 + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36668 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36669 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36670 + */
36671 +function getLineColFromPtr(string, ptr) {
36672 + let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
36673 + return [lines.length, lines.pop().length + 1];
36674 +}
36675 +function makeCodeBlock(string, line, column) {
36676 + let lines = string.split(/\r\n|\n|\r/g);
36677 + let codeblock = '';
36678 + let numberLen = (Math.log10(line + 1) | 0) + 1;
36679 + for (let i = line - 1; i <= line + 1; i++) {
36680 + let l = lines[i - 1];
36681 + if (!l)
36682 + continue;
36683 + codeblock += i.toString().padEnd(numberLen, ' ');
36684 + codeblock += ': ';
36685 + codeblock += l;
36686 + codeblock += '\n';
36687 + if (i === line) {
36688 + codeblock += ' '.repeat(numberLen + column + 2);
36689 + codeblock += '^\n';
36690 + }
36691 + }
36692 + return codeblock;
36693 +}
36694 +class TomlError extends Error {
36695 + line;
36696 + column;
36697 + codeblock;
36698 + constructor(message, options) {
36699 + const [line, column] = getLineColFromPtr(options.toml, options.ptr);
36700 + const codeblock = makeCodeBlock(options.toml, line, column);
36701 + super(`Invalid TOML document: ${message}\n\n${codeblock}`, options);
36702 + this.line = line;
36703 + this.column = column;
36704 + this.codeblock = codeblock;
36705 + }
36706 +}
36707 +//# sourceMappingURL=error.js.map
36821 36708 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/primitive.js
36822 36709 /*!
36823 36710 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -36848,102 +36735,159 @@ class TomlDate extends Date {
36848 36735 */
36849 36736
36850 36737
36851
36738 +// let CTRL_REGEX = /[\x00-\x08\x0f-\x1f\x7f]/
36852 36739 let INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
36853 36740 let FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
36854 36741 let LEADING_ZERO = /^[+-]?0[0-9_]/;
36855 let ESCAPE_REGEX = /^[0-9a-f]{2,8}$/i;
36856 let ESC_MAP = {
36857 b: '\b',
36858 t: '\t',
36859 n: '\n',
36860 f: '\f',
36861 r: '\r',
36862 e: '\x1b',
36863 '"': '"',
36864 '\\': '\\',
36865 };
36866 function parseString(str, ptr = 0, endPtr = str.length) {
36867 let isLiteral = str[ptr] === '\'';
36868 let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
36742 +function parseString(str, ptr) {
36743 + let c = str[ptr++];
36744 + let first = c;
36745 + let isLiteral = c === "'";
36746 + let isMultiline = c === str[ptr] && c === str[ptr + 1];
36869 36747 if (isMultiline) {
36870 endPtr -= 2;
36871 if (str[ptr += 2] === '\r')
36872 ptr++;
36873 if (str[ptr] === '\n')
36748 + // Trim initial newline
36749 + if (str[ptr += 2] === '\n')
36874 36750 ptr++;
36751 + else if (str[ptr] === '\r' && str[ptr + 1] === '\n')
36752 + ptr += 2;
36753 + }
36754 + /*
36755 + The fast path does not seem to bring significant performance gains, so it's commented out.
36756 + Kept for reference and/or future fafoing.
36757 +
36758 + Without: spec 5.08 µs/iter 3.88 ipc (99.44% cache) 23.90 branch misses 28.61k cycles 111.01k instructions
36759 + 5MB 115.73 ms/iter 2.51 ipc (98.36% cache) 3.12M branch misses 619.30M cycles 1.56G instructions
36760 +
36761 + With: spec 5.09 µs/iter 3.90 ipc (99.46% cache) 24.42 branch misses 28.57k cycles 111.49k instructions
36762 + 5MB 113.89 ms/iter 2.47 ipc (98.38% cache) 3.12M branch misses 611.94M cycles 1.51G instructions
36763 +
36764 + if (c === "'") {
36765 + // Literal strings fast path - no transform needs to occur; just grab the str and that's it
36766 + let endPtr = str.indexOf(isMultiline ? "'''" : "'", ptr)
36767 + if (endPtr < 0) {
36768 + throw new TomlError("unfinished string literal", { toml: str, ptr })
36769 + }
36770 +
36771 + if (isMultiline) {
36772 + // If the string ends with 4-5 quotes, then the first 1-2 are part of the string
36773 + if (str[endPtr + 3] === "'") endPtr++
36774 + if (str[endPtr + 3] === "'") endPtr++
36775 + }
36776 +
36777 + let string = str.slice(ptr, endPtr)
36778 + if (CTRL_REGEX.test(string)) {
36779 + let match = string.match(CTRL_REGEX)!
36780 + throw new TomlError('control characters are not allowed in strings', { toml: str, ptr: ptr + (match.index ?? 0) })
36781 + }
36782 + return [string, endPtr + (isMultiline ? 3 : 1)]
36875 36783 }
36876 let tmp = 0;
36877 let isEscape;
36784 + */
36878 36785 let parsed = '';
36879 36786 let sliceStart = ptr;
36880 while (ptr < endPtr - 1) {
36881 let c = str[ptr++];
36882 if (c === '\n' || (c === '\r' && str[ptr] === '\n')) {
36883 if (!isMultiline) {
36884 throw new TomlError('newlines are not allowed in strings', {
36885 toml: str,
36886 ptr: ptr - 1,
36887 });
36888 }
36787 + // states:
36788 + // 0 - decoding
36789 + // 1 - decoding escape
36790 + // 2 - whitespace escape (no newline encountered yet, must fail on non-whitespace)
36791 + // 3 - whitespace escape (newline encountered, allowed to transition back to normal decode)
36792 + let state = 0;
36793 + for (let i = ptr; i < str.length; i++) {
36794 + c = str[i];
36795 + // Deal with newlines first, since that simplifies control character checking and handling across all states
36796 + if (isMultiline && (c === '\n' || (c === '\r' && str[i + 1] === '\n'))) {
36797 + state = state && 3;
36889 36798 }
36799 + // Control characters are banned in TOML, so we throw an error if we encounter them
36890 36800 else if ((c < '\x20' && c !== '\t') || c === '\x7f') {
36891 36801 throw new TomlError('control characters are not allowed in strings', {
36892 36802 toml: str,
36893 ptr: ptr - 1,
36803 + ptr: i,
36894 36804 });
36895 36805 }
36896 if (isEscape) {
36897 isEscape = false;
36898 if (c === 'x' || c === 'u' || c === 'U') {
36899 // Unicode escape
36900 let code = str.slice(ptr, (ptr += (c === 'x' ? 2 : c === 'u' ? 4 : 8)));
36901 if (!ESCAPE_REGEX.test(code)) {
36902 throw new TomlError('invalid unicode escape', {
36903 toml: str,
36904 ptr: tmp,
36905 });
36906 }
36907 try {
36908 parsed += String.fromCodePoint(parseInt(code, 16));
36909 }
36910 catch {
36911 throw new TomlError('invalid unicode escape', {
36912 toml: str,
36913 ptr: tmp,
36914 });
36915 }
36806 + // The string might terminate while we're parsing through a newline escape.
36807 + // It must have encountered a newline; otherwise, it'll simply fail in another branch.
36808 + else if ((!state || state === 3) && c === first && (!isMultiline || (str[i + 1] === first && str[i + 2] === first))) {
36809 + if (isMultiline) {
36810 + // If the string ends with 4-5 quotes, then the first 1-2 are part of the string
36811 + if (str[i + 3] === first)
36812 + i++;
36813 + if (str[i + 3] === first)
36814 + i++;
36916 36815 }
36917 else if (isMultiline && (c === '\n' || c === ' ' || c === '\t' || c === '\r')) {
36918 // Multiline escape
36919 ptr = skipVoid(str, ptr - 1, true);
36920 if (str[ptr] !== '\n' && str[ptr] !== '\r') {
36921 throw new TomlError('invalid escape: only line-ending whitespace may be escaped', {
36922 toml: str,
36923 ptr: tmp,
36924 });
36816 + return [
36817 + // If we're in a newline escape still, then there's nothing to add.
36818 + // Also try to avoid concat if there's nothing to add to parsed, or nothing has been added to parsed.
36819 + state ? parsed : parsed + str.slice(sliceStart, i),
36820 + i + (isMultiline ? 3 : 1),
36821 + ];
36822 + }
36823 + else if (!state) {
36824 + if (!isLiteral && c === '\\') {
36825 + parsed += str.slice(sliceStart, (sliceStart = i));
36826 + state = 1;
36827 + }
36828 + }
36829 + else if (state === 1) {
36830 + if (c === 'x' || c === 'u' || c === 'U') { // Unicode escape
36831 + let value = 0;
36832 + let len = c === 'x' ? 2 : c === 'u' ? 4 : 8;
36833 + for (let j = 0; j < len; j++, i++) {
36834 + let hex = str.charCodeAt(i + 1);
36835 + let digit =
36836 + /* 0-9 */ hex >= 0x30 && hex <= 0x39 ? hex - 0x30 :
36837 + /* A-F */ hex >= 0x41 && hex <= 0x46 ? hex - 0x41 + 10 :
36838 + /* a-f */ hex >= 0x61 && hex <= 0x66 ? hex - 0x61 + 10 : -1;
36839 + if (digit < 0)
36840 + throw new TomlError('invalid non-hex character in unicode escape', { toml: str, ptr: i + 1 });
36841 + value = (value << 4) | digit;
36842 + }
36843 + // Because JS does bitwise on signed 32bit integers, all 0xfzzzzzzz values are actually seen as negative
36844 + if (value < 0 || value > 0x10ffff || (value >= 0xd800 && value <= 0xdfff)) {
36845 + throw new TomlError('invalid unicode escape', { toml: str, ptr: i });
36925 36846 }
36926 ptr = skipVoid(str, ptr);
36847 + parsed += String.fromCodePoint(value);
36848 + sliceStart = i + 1;
36849 + state = 0;
36927 36850 }
36928 else if (c in ESC_MAP) {
36929 // Classic escape
36930 parsed += ESC_MAP[c];
36851 + else if (c === ' ' || c === '\t') { // If it was a newline, it'd have been handled earlier
36852 + state = 2;
36931 36853 }
36932 36854 else {
36933 throw new TomlError('unrecognized escape sequence', {
36855 + if (c === 'b')
36856 + parsed += '\b';
36857 + else if (c === 't')
36858 + parsed += '\t';
36859 + else if (c === 'n')
36860 + parsed += '\n';
36861 + else if (c === 'f')
36862 + parsed += '\f';
36863 + else if (c === 'r')
36864 + parsed += '\r';
36865 + else if (c === 'e')
36866 + parsed += '\x1b';
36867 + else if (c === '"')
36868 + parsed += '"';
36869 + else if (c === '\\')
36870 + parsed += '\\';
36871 + else
36872 + throw new TomlError('unrecognized escape sequence', { toml: str, ptr: i });
36873 + sliceStart = i + 1;
36874 + state = 0;
36875 + }
36876 + }
36877 + else if (c !== ' ' && c !== '\t') {
36878 + if (state === 2) {
36879 + throw new TomlError('invalid escape: only line-ending whitespace may be escaped', {
36934 36880 toml: str,
36935 ptr: tmp,
36881 + ptr: sliceStart,
36936 36882 });
36937 36883 }
36938 sliceStart = ptr;
36939 }
36940 else if (!isLiteral && c === '\\') {
36941 tmp = ptr - 1;
36942 isEscape = true;
36943 parsed += str.slice(sliceStart, tmp);
36884 + // State cannot be zero, or we'd have branched earlier already.
36885 + // If it's a backslash, immediately transition to the escape state so it can be processed.
36886 + state = !isLiteral && c === '\\' ? 1 : 0;
36887 + sliceStart = i;
36944 36888 }
36945 36889 }
36946 return parsed + str.slice(sliceStart, endPtr - 1);
36890 + throw new TomlError('unfinished string', { toml: str, ptr });
36947 36891 }
36948 36892 function parseValue(value, toml, ptr, integersAsBigInt) {
36949 36893 // Constant values
@@ -36998,7 +36942,94 @@ function parseValue(value, toml, ptr, integersAsBigInt) {
36998 36942 }
36999 36943 return date;
37000 36944 }
36945 +//# sourceMappingURL=primitive.js.map
36946 +;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/util.js
36947 +/*!
36948 + * Copyright (c) Squirrel Chat et al., All rights reserved.
36949 + * SPDX-License-Identifier: BSD-3-Clause
36950 + *
36951 + * Redistribution and use in source and binary forms, with or without
36952 + * modification, are permitted provided that the following conditions are met:
36953 + *
36954 + * 1. Redistributions of source code must retain the above copyright notice, this
36955 + * list of conditions and the following disclaimer.
36956 + * 2. Redistributions in binary form must reproduce the above copyright notice,
36957 + * this list of conditions and the following disclaimer in the
36958 + * documentation and/or other materials provided with the distribution.
36959 + * 3. Neither the name of the copyright holder nor the names of its contributors
36960 + * may be used to endorse or promote products derived from this software without
36961 + * specific prior written permission.
36962 + *
36963 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
36964 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36965 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36966 + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36967 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36968 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36969 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36970 + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36971 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36972 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36973 + */
37001 36974
36975 +function indexOfNewline(str, start = 0, end = str.length) {
36976 + let idx = str.indexOf('\n', start);
36977 + if (str[idx - 1] === '\r')
36978 + idx--;
36979 + return idx <= end ? idx : -1;
36980 +}
36981 +function skipComment(str, ptr) {
36982 + for (let i = ptr; i < str.length; i++) {
36983 + let c = str[i];
36984 + if (c === '\n')
36985 + return i;
36986 + if (c === '\r' && str[i + 1] === '\n')
36987 + return i + 1;
36988 + if ((c < '\x20' && c !== '\t') || c === '\x7f') {
36989 + throw new TomlError('control characters are not allowed in comments', {
36990 + toml: str,
36991 + ptr: ptr,
36992 + });
36993 + }
36994 + }
36995 + return str.length;
36996 +}
36997 +function skipVoid(str, ptr, banNewLines, banComments) {
36998 + let c;
36999 + while (1) {
37000 + while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || (c === '\r' && str[ptr + 1] === '\n'))))
37001 + ptr++;
37002 + // Tucking the return statement here would save 5 characters >:)
37003 + // But TypeScript fails to detect there is no way to exit the loop so it complains about the lack of final return
37004 + if (banComments || c !== '#')
37005 + break;
37006 + ptr = skipComment(str, ptr);
37007 + }
37008 + return ptr;
37009 +}
37010 +function skipUntil(str, ptr, sep, end, banNewLines = false) {
37011 + if (!end) {
37012 + ptr = indexOfNewline(str, ptr);
37013 + return ptr < 0 ? str.length : ptr;
37014 + }
37015 + for (let i = ptr; i < str.length; i++) {
37016 + let c = str[i];
37017 + if (c === '#') {
37018 + i = indexOfNewline(str, i);
37019 + }
37020 + else if (c === sep) {
37021 + return i + 1;
37022 + }
37023 + else if (c === end || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
37024 + return i;
37025 + }
37026 + }
37027 + throw new TomlError('cannot find end of structure', {
37028 + toml: str,
37029 + ptr: ptr,
37030 + });
37031 +}
37032 +//# sourceMappingURL=util.js.map
37002 37033 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/extract.js
37003 37034 /*!
37004 37035 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -37046,7 +37077,7 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) {
37046 37077 if (depth === 0) {
37047 37078 throw new TomlError('document contains excessively nested structures. aborting.', {
37048 37079 toml: str,
37049 ptr: ptr
37080 + ptr: ptr,
37050 37081 });
37051 37082 }
37052 37083 let c = str[ptr];
@@ -37067,10 +37098,8 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) {
37067 37098 }
37068 37099 return [value, endPtr];
37069 37100 }
37070 let endPtr;
37071 37101 if (c === '"' || c === "'") {
37072 endPtr = getStringEnd(str, ptr);
37073 let parsed = parseString(str, ptr, endPtr);
37102 + let [parsed, endPtr] = parseString(str, ptr);
37074 37103 if (end) {
37075 37104 endPtr = skipVoid(str, endPtr);
37076 37105 if (str[endPtr] && str[endPtr] !== ',' && str[endPtr] !== end && str[endPtr] !== '\n' && str[endPtr] !== '\r') {
@@ -37079,28 +37108,30 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) {
37079 37108 ptr: endPtr,
37080 37109 });
37081 37110 }
37082 endPtr += (+(str[endPtr] === ','));
37111 + if (str[endPtr] === ',')
37112 + endPtr++;
37083 37113 }
37084 37114 return [parsed, endPtr];
37085 37115 }
37086 endPtr = skipUntil(str, ptr, ',', end);
37087 let slice = sliceAndTrimEndOf(str, ptr, endPtr - (+(str[endPtr - 1] === ',')));
37116 + let endPtr = skipUntil(str, ptr, ',', end);
37117 + let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === ',' ? 1 : 0));
37088 37118 if (!slice[0]) {
37089 37119 throw new TomlError('incomplete key-value declaration: no value specified', {
37090 37120 toml: str,
37091 ptr: ptr
37121 + ptr: ptr,
37092 37122 });
37093 37123 }
37094 37124 if (end && slice[1] > -1) {
37095 37125 endPtr = skipVoid(str, ptr + slice[1]);
37096 endPtr += +(str[endPtr] === ',');
37126 + if (str[endPtr] === ',')
37127 + endPtr++;
37097 37128 }
37098 37129 return [
37099 37130 parseValue(slice[0], str, ptr, integersAsBigInt),
37100 37131 endPtr,
37101 37132 ];
37102 37133 }
37103
37134 +//# sourceMappingURL=extract.js.map
37104 37135 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/struct.js
37105 37136 /*!
37106 37137 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -37145,24 +37176,18 @@ function parseKey(str, ptr, end = '=') {
37145 37176 });
37146 37177 }
37147 37178 do {
37148 let c = str[ptr = ++dot];
37179 + let c = str[(ptr = ++dot)];
37149 37180 // If it's whitespace, ignore
37150 37181 if (c !== ' ' && c !== '\t') {
37151 37182 // If it's a string
37152 if (c === '"' || c === '\'') {
37183 + if (c === '"' || c === "'") {
37153 37184 if (c === str[ptr + 1] && c === str[ptr + 2]) {
37154 37185 throw new TomlError('multiline strings are not allowed in keys', {
37155 37186 toml: str,
37156 37187 ptr: ptr,
37157 37188 });
37158 37189 }
37159 let eos = getStringEnd(str, ptr);
37160 if (eos < 0) {
37161 throw new TomlError('unfinished string encountered', {
37162 toml: str,
37163 ptr: ptr,
37164 });
37165 }
37190 + let [part, eos] = parseString(str, ptr);
37166 37191 dot = str.indexOf('.', eos);
37167 37192 let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
37168 37193 let newLine = indexOfNewline(strEnd);
@@ -37187,7 +37212,7 @@ function parseKey(str, ptr, end = '=') {
37187 37212 });
37188 37213 }
37189 37214 }
37190 parsed.push(parseString(str, ptr, eos));
37215 + parsed.push(part);
37191 37216 }
37192 37217 else {
37193 37218 // Normal raw key part consumption and validation
@@ -37286,7 +37311,7 @@ function parseArray(str, ptr, depth, integersAsBigInt) {
37286 37311 }
37287 37312 return [res, ptr];
37288 37313 }
37289
37314 +//# sourceMappingURL=struct.js.map
37290 37315 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/parse.js
37291 37316 /*!
37292 37317 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -37349,8 +37374,7 @@ function peekTable(key, table, meta, type) {
37349 37374 }
37350 37375 m[k] = {
37351 37376 t: i < key.length - 1 && type === 2 /* Type.ARRAY */
37352 ? 3 /* Type.ARRAY_DOTTED */
37353 : type,
37377 + ? 3 /* Type.ARRAY_DOTTED */ : type,
37354 37378 d: false,
37355 37379 i: 0,
37356 37380 c: {},
@@ -37391,7 +37415,7 @@ function parse_parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
37391 37415 for (let ptr = skipVoid(toml, 0); ptr < toml.length;) {
37392 37416 if (toml[ptr] === '[') {
37393 37417 let isTableArray = toml[++ptr] === '[';
37394 let k = parseKey(toml, ptr += +isTableArray, ']');
37418 + let k = parseKey(toml, (ptr += +isTableArray), ']');
37395 37419 if (isTableArray) {
37396 37420 if (toml[k[1] - 1] !== ']') {
37397 37421 throw new TomlError('expected end of table declaration', {
@@ -37429,14 +37453,14 @@ function parse_parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
37429 37453 if (toml[ptr] && toml[ptr] !== '\n' && toml[ptr] !== '\r') {
37430 37454 throw new TomlError('each key-value declaration must be followed by an end-of-line', {
37431 37455 toml: toml,
37432 ptr: ptr
37456 + ptr: ptr,
37433 37457 });
37434 37458 }
37435 37459 ptr = skipVoid(toml, ptr);
37436 37460 }
37437 37461 return res;
37438 37462 }
37439
37463 +//# sourceMappingURL=parse.js.map
37440 37464 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/stringify.js
37441 37465 /*!
37442 37466 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -37497,7 +37521,7 @@ function stringifyValue(val, type, depth, numberAsFloat) {
37497 37521 return 'inf';
37498 37522 if (val === -Infinity)
37499 37523 return '-inf';
37500 if (numberAsFloat && Number.isInteger(val))
37524 + if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val)))
37501 37525 return val.toFixed(1);
37502 37526 return val.toString();
37503 37527 }
@@ -37605,7 +37629,7 @@ function stringify(obj, { maxDepth = 1000, numbersAsFloat = false } = {}) {
37605 37629 return str + '\n';
37606 37630 return str;
37607 37631 }
37608
37632 +//# sourceMappingURL=stringify.js.map
37609 37633 ;// CONCATENATED MODULE: ./node_modules/smol-toml/dist/index.js
37610 37634 /*!
37611 37635 * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -37640,7 +37664,7 @@ function stringify(obj, { maxDepth = 1000, numbersAsFloat = false } = {}) {
37640 37664
37641 37665 /* harmony default export */ const dist = ({ parse: parse_parse, stringify: stringify, TomlDate: TomlDate, TomlError: TomlError });
37642 37666
37643
37667 +//# sourceMappingURL=index.js.map
37644 37668 ;// CONCATENATED MODULE: ./src/setup-beam.js
37645 37669
37646 37670
modified package-lock.json
+17 −4
@@ -12,7 +12,7 @@
12 12 "@actions/tool-cache": "4.0.0",
13 13 "csv-parse": "7.0.0",
14 14 "semver": "7.7.4",
15 "smol-toml": "1.6.1"
15 + "smol-toml": "1.7.0"
16 16 },
17 17 "devDependencies": {
18 18 "@eslint/js": "10.0.1",
@@ -2299,6 +2299,19 @@
2299 2299 "node": ">= 4"
2300 2300 }
2301 2301 },
2302 + "node_modules/markdownlint-cli/node_modules/smol-toml": {
2303 + "version": "1.6.1",
2304 + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz",
2305 + "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==",
2306 + "dev": true,
2307 + "license": "BSD-3-Clause",
2308 + "engines": {
2309 + "node": ">= 18"
2310 + },
2311 + "funding": {
2312 + "url": "https://github.com/sponsors/cyyynthia"
2313 + }
2314 + },
2302 2315 "node_modules/matcher": {
2303 2316 "version": "3.0.0",
2304 2317 "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
@@ -3337,9 +3350,9 @@
3337 3350 }
3338 3351 },
3339 3352 "node_modules/smol-toml": {
3340 "version": "1.6.1",
3341 "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz",
3342 "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==",
3353 + "version": "1.7.0",
3354 + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.0.tgz",
3355 + "integrity": "sha512-aqVvWoyO21L23mb+drl4RmMXbf6N7FdHjAhTRA9ZBL7apWBgfWC16KjrASI+1p9GAroljyMHj6fK67i0UiTNvQ==",
3343 3356 "license": "BSD-3-Clause",
3344 3357 "engines": {
3345 3358 "node": ">= 18"
modified package.json
+1 −1
@@ -22,7 +22,7 @@
22 22 "@actions/tool-cache": "4.0.0",
23 23 "csv-parse": "7.0.0",
24 24 "semver": "7.7.4",
25 "smol-toml": "1.6.1"
25 + "smol-toml": "1.7.0"
26 26 },
27 27 "devDependencies": {
28 28 "@eslint/js": "10.0.1",

Parents: b0ba423