diff --git a/bench/parseLargeMixed.bench.ts b/bench/parseLargeMixed.bench.ts index 1001f17..a205f89 100644 --- a/bench/parseLargeMixed.bench.ts +++ b/bench/parseLargeMixed.bench.ts @@ -32,6 +32,7 @@ import { parse as smolTomlParse } from '../src/index.js' import { parse as iarnaTomlParse } from '@iarna/toml' import { parse as ltdJTomlParse } from '@ltd/j-toml' import fastTomlParse from 'fast-toml' +import { decode as tomlNodejsParse } from 'toml-nodejs' let toml = await readFile(new URL('./testfiles/5mb-mixed.toml', import.meta.url), 'utf8') @@ -51,3 +52,7 @@ bench('@ltd/j-toml', () => { bench('fast-toml', () => { fastTomlParse(toml) }) + +bench('toml-nodejs', () => { + tomlNodejsParse(toml) +}) diff --git a/bench/parseSpecExample.bench.ts b/bench/parseSpecExample.bench.ts index 87afded..15e6e21 100644 --- a/bench/parseSpecExample.bench.ts +++ b/bench/parseSpecExample.bench.ts @@ -32,6 +32,7 @@ import { parse as smolTomlParse } from '../src/index.js' import { parse as iarnaTomlParse } from '@iarna/toml' import { parse as ltdJTomlParse } from '@ltd/j-toml' import fastTomlParse from 'fast-toml' +import { decode as tomlNodejsParse } from 'toml-nodejs' let toml = await readFile(new URL('./testfiles/toml-spec-example.toml', import.meta.url), 'utf8') @@ -50,3 +51,7 @@ bench('@ltd/j-toml', () => { bench('fast-toml', () => { fastTomlParse(toml) }) + +bench('toml-nodejs', () => { + tomlNodejsParse(toml) +}) diff --git a/package.json b/package.json index e678401..cd0ba46 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "type": "module", "engines": { "node": ">= 18", - "pnpm": ">= 7.24" + "pnpm": ">= 8" }, "scripts": { "build": "tsc", @@ -29,6 +29,7 @@ "@types/node": "^20.1.0", "@vitest/ui": "^0.31.0", "fast-toml": "^0.5.4", + "toml-nodejs": "^0.3.0", "typescript": "^5.0.4", "vitest": "^0.31.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fea7c7e..99cf9e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,50 +1,61 @@ -lockfileVersion: 5.4 - -specifiers: - '@iarna/toml': 3.0.0 - '@ltd/j-toml': ^1.38.0 - '@tsconfig/esm': ^1.0.3 - '@tsconfig/node-lts': ^18.12.1 - '@tsconfig/strictest': ^2.0.1 - '@types/node': ^20.1.0 - '@vitest/ui': ^0.31.0 - fast-toml: ^0.5.4 - typescript: ^5.0.4 - vitest: ^0.31.0 +lockfileVersion: '6.0' devDependencies: - '@iarna/toml': 3.0.0 - '@ltd/j-toml': 1.38.0 - '@tsconfig/esm': 1.0.3 - '@tsconfig/node-lts': 18.12.1 - '@tsconfig/strictest': 2.0.1 - '@types/node': 20.1.0 - '@vitest/ui': 0.31.0_vitest@0.31.0 - fast-toml: 0.5.4 - typescript: 5.0.4 - vitest: 0.31.0_@vitest+ui@0.31.0 + '@iarna/toml': + specifier: 3.0.0 + version: 3.0.0 + '@ltd/j-toml': + specifier: ^1.38.0 + version: 1.38.0 + '@tsconfig/esm': + specifier: ^1.0.3 + version: 1.0.3 + '@tsconfig/node-lts': + specifier: ^18.12.1 + version: 18.12.1 + '@tsconfig/strictest': + specifier: ^2.0.1 + version: 2.0.1 + '@types/node': + specifier: ^20.1.0 + version: 20.1.0 + '@vitest/ui': + specifier: ^0.31.0 + version: 0.31.0(vitest@0.31.0) + fast-toml: + specifier: ^0.5.4 + version: 0.5.4 + toml-nodejs: + specifier: ^0.3.0 + version: 0.3.0 + typescript: + specifier: ^5.0.4 + version: 5.0.4 + vitest: + specifier: ^0.31.0 + version: 0.31.0(@vitest/ui@0.31.0) packages: - /@esbuild/android-arm/0.17.18: - resolution: {integrity: sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==} + /@esbuild/android-arm64@0.17.18: + resolution: {integrity: sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==} engines: {node: '>=12'} - cpu: [arm] + cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@esbuild/android-arm64/0.17.18: - resolution: {integrity: sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==} + /@esbuild/android-arm@0.17.18: + resolution: {integrity: sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==} engines: {node: '>=12'} - cpu: [arm64] + cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@esbuild/android-x64/0.17.18: + /@esbuild/android-x64@0.17.18: resolution: {integrity: sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==} engines: {node: '>=12'} cpu: [x64] @@ -53,7 +64,7 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64/0.17.18: + /@esbuild/darwin-arm64@0.17.18: resolution: {integrity: sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==} engines: {node: '>=12'} cpu: [arm64] @@ -62,7 +73,7 @@ packages: dev: true optional: true - /@esbuild/darwin-x64/0.17.18: + /@esbuild/darwin-x64@0.17.18: resolution: {integrity: sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==} engines: {node: '>=12'} cpu: [x64] @@ -71,7 +82,7 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64/0.17.18: + /@esbuild/freebsd-arm64@0.17.18: resolution: {integrity: sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==} engines: {node: '>=12'} cpu: [arm64] @@ -80,7 +91,7 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64/0.17.18: + /@esbuild/freebsd-x64@0.17.18: resolution: {integrity: sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==} engines: {node: '>=12'} cpu: [x64] @@ -89,25 +100,25 @@ packages: dev: true optional: true - /@esbuild/linux-arm/0.17.18: - resolution: {integrity: sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==} + /@esbuild/linux-arm64@0.17.18: + resolution: {integrity: sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==} engines: {node: '>=12'} - cpu: [arm] + cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@esbuild/linux-arm64/0.17.18: - resolution: {integrity: sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==} + /@esbuild/linux-arm@0.17.18: + resolution: {integrity: sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==} engines: {node: '>=12'} - cpu: [arm64] + cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@esbuild/linux-ia32/0.17.18: + /@esbuild/linux-ia32@0.17.18: resolution: {integrity: sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==} engines: {node: '>=12'} cpu: [ia32] @@ -116,7 +127,7 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.17.18: + /@esbuild/linux-loong64@0.17.18: resolution: {integrity: sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==} engines: {node: '>=12'} cpu: [loong64] @@ -125,7 +136,7 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el/0.17.18: + /@esbuild/linux-mips64el@0.17.18: resolution: {integrity: sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==} engines: {node: '>=12'} cpu: [mips64el] @@ -134,7 +145,7 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64/0.17.18: + /@esbuild/linux-ppc64@0.17.18: resolution: {integrity: sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==} engines: {node: '>=12'} cpu: [ppc64] @@ -143,7 +154,7 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64/0.17.18: + /@esbuild/linux-riscv64@0.17.18: resolution: {integrity: sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==} engines: {node: '>=12'} cpu: [riscv64] @@ -152,7 +163,7 @@ packages: dev: true optional: true - /@esbuild/linux-s390x/0.17.18: + /@esbuild/linux-s390x@0.17.18: resolution: {integrity: sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==} engines: {node: '>=12'} cpu: [s390x] @@ -161,7 +172,7 @@ packages: dev: true optional: true - /@esbuild/linux-x64/0.17.18: + /@esbuild/linux-x64@0.17.18: resolution: {integrity: sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==} engines: {node: '>=12'} cpu: [x64] @@ -170,7 +181,7 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64/0.17.18: + /@esbuild/netbsd-x64@0.17.18: resolution: {integrity: sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==} engines: {node: '>=12'} cpu: [x64] @@ -179,7 +190,7 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64/0.17.18: + /@esbuild/openbsd-x64@0.17.18: resolution: {integrity: sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==} engines: {node: '>=12'} cpu: [x64] @@ -188,7 +199,7 @@ packages: dev: true optional: true - /@esbuild/sunos-x64/0.17.18: + /@esbuild/sunos-x64@0.17.18: resolution: {integrity: sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==} engines: {node: '>=12'} cpu: [x64] @@ -197,7 +208,7 @@ packages: dev: true optional: true - /@esbuild/win32-arm64/0.17.18: + /@esbuild/win32-arm64@0.17.18: resolution: {integrity: sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==} engines: {node: '>=12'} cpu: [arm64] @@ -206,7 +217,7 @@ packages: dev: true optional: true - /@esbuild/win32-ia32/0.17.18: + /@esbuild/win32-ia32@0.17.18: resolution: {integrity: sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==} engines: {node: '>=12'} cpu: [ia32] @@ -215,7 +226,7 @@ packages: dev: true optional: true - /@esbuild/win32-x64/0.17.18: + /@esbuild/win32-x64@0.17.18: resolution: {integrity: sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==} engines: {node: '>=12'} cpu: [x64] @@ -224,19 +235,19 @@ packages: dev: true optional: true - /@iarna/toml/3.0.0: + /@iarna/toml@3.0.0: resolution: {integrity: sha512-td6ZUkz2oS3VeleBcN+m//Q6HlCFCPrnI0FZhrt/h4XqLEdOyYp2u21nd8MdsR+WJy5r9PTDaHTDDfhf4H4l6Q==} dev: true - /@jridgewell/sourcemap-codec/1.4.15: + /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@ltd/j-toml/1.38.0: + /@ltd/j-toml@1.38.0: resolution: {integrity: sha512-lYtBcmvHustHQtg4X7TXUu1Xa/tbLC3p2wLvgQI+fWVySguVZJF60Snxijw5EiohumxZbR10kWYFFebh1zotiw==} dev: true - /@nodelib/fs.scandir/2.1.5: + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: @@ -244,12 +255,12 @@ packages: run-parallel: 1.2.0 dev: true - /@nodelib/fs.stat/2.0.5: + /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} dev: true - /@nodelib/fs.walk/1.2.8: + /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} dependencies: @@ -257,37 +268,37 @@ packages: fastq: 1.15.0 dev: true - /@polka/url/1.0.0-next.21: + /@polka/url@1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@tsconfig/esm/1.0.3: + /@tsconfig/esm@1.0.3: resolution: {integrity: sha512-Gp56rIc3R8ab032nXMUitmc7YIb4nAi8DQ6Qt47tuL0Ssn9LIOm+o2FQmqPu3jX4z0TsqgzWwkmVygxcq+yHYg==} dev: true - /@tsconfig/node-lts/18.12.1: + /@tsconfig/node-lts@18.12.1: resolution: {integrity: sha512-UkIaMWDwJ+qJX/os8lzYh7m47qQJY7sIp1WZiEStASrpzczp27+jA0fJES+IjnS2OlDDLeBghNrVkKw8iYIRdA==} dev: true - /@tsconfig/strictest/2.0.1: + /@tsconfig/strictest@2.0.1: resolution: {integrity: sha512-7JHHCbyCsGUxLd0pDbp24yz3zjxw2t673W5oAP6HCEdr/UUhaRhYd3SSnUsGCk+VnPVJVA4mXROzbhI+nyIk+w==} dev: true - /@types/chai-subset/1.3.3: + /@types/chai-subset@1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: '@types/chai': 4.3.5 dev: true - /@types/chai/4.3.5: + /@types/chai@4.3.5: resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} dev: true - /@types/node/20.1.0: + /@types/node@20.1.0: resolution: {integrity: sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A==} dev: true - /@vitest/expect/0.31.0: + /@vitest/expect@0.31.0: resolution: {integrity: sha512-Jlm8ZTyp6vMY9iz9Ny9a0BHnCG4fqBa8neCF6Pk/c/6vkUk49Ls6UBlgGAU82QnzzoaUs9E/mUhq/eq9uMOv/g==} dependencies: '@vitest/spy': 0.31.0 @@ -295,7 +306,7 @@ packages: chai: 4.3.7 dev: true - /@vitest/runner/0.31.0: + /@vitest/runner@0.31.0: resolution: {integrity: sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==} dependencies: '@vitest/utils': 0.31.0 @@ -304,7 +315,7 @@ packages: pathe: 1.1.0 dev: true - /@vitest/snapshot/0.31.0: + /@vitest/snapshot@0.31.0: resolution: {integrity: sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==} dependencies: magic-string: 0.30.0 @@ -312,13 +323,13 @@ packages: pretty-format: 27.5.1 dev: true - /@vitest/spy/0.31.0: + /@vitest/spy@0.31.0: resolution: {integrity: sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==} dependencies: tinyspy: 2.1.0 dev: true - /@vitest/ui/0.31.0_vitest@0.31.0: + /@vitest/ui@0.31.0(vitest@0.31.0): resolution: {integrity: sha512-Dy86l6r3/dbJposgm7w+oqb/15UWJ0lDBbEQaS1ived3+0CTaMbT8OMkUf9vNBkSL47kvBHEBnZLa5fw5i9gUQ==} peerDependencies: vitest: '>=0.30.1 <1' @@ -330,10 +341,10 @@ packages: pathe: 1.1.0 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.31.0_@vitest+ui@0.31.0 + vitest: 0.31.0(@vitest/ui@0.31.0) dev: true - /@vitest/utils/0.31.0: + /@vitest/utils@0.31.0: resolution: {integrity: sha512-kahaRyLX7GS1urekRXN2752X4gIgOGVX4Wo8eDUGUkTWlGpXzf5ZS6N9RUUS+Re3XEE8nVGqNyxkSxF5HXlGhQ==} dependencies: concordance: 5.0.4 @@ -341,48 +352,48 @@ packages: pretty-format: 27.5.1 dev: true - /acorn-walk/8.2.0: + /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} dev: true - /acorn/8.8.2: + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /ansi-regex/5.0.1: + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} dev: true - /ansi-styles/5.2.0: + /ansi-styles@5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} dev: true - /assertion-error/1.1.0: + /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /blueimp-md5/2.19.0: + /blueimp-md5@2.19.0: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} dev: true - /braces/3.0.2: + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} dependencies: fill-range: 7.0.1 dev: true - /cac/6.7.14: + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} dev: true - /chai/4.3.7: + /chai@4.3.7: resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} engines: {node: '>=4'} dependencies: @@ -395,11 +406,11 @@ packages: type-detect: 4.0.8 dev: true - /check-error/1.0.2: + /check-error@1.0.2: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} dev: true - /concordance/5.0.4: + /concordance@5.0.4: resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} dependencies: @@ -413,14 +424,14 @@ packages: well-known-symbols: 2.0.0 dev: true - /date-time/3.1.0: + /date-time@3.1.0: resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} engines: {node: '>=6'} dependencies: time-zone: 1.0.0 dev: true - /debug/4.3.4: + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -432,14 +443,14 @@ packages: ms: 2.1.2 dev: true - /deep-eql/4.1.3: + /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'} dependencies: type-detect: 4.0.8 dev: true - /esbuild/0.17.18: + /esbuild@0.17.18: resolution: {integrity: sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==} engines: {node: '>=12'} hasBin: true @@ -469,16 +480,16 @@ packages: '@esbuild/win32-x64': 0.17.18 dev: true - /esutils/2.0.3: + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} dev: true - /fast-diff/1.2.0: + /fast-diff@1.2.0: resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} dev: true - /fast-glob/3.2.12: + /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} dependencies: @@ -489,32 +500,32 @@ packages: micromatch: 4.0.5 dev: true - /fast-toml/0.5.4: + /fast-toml@0.5.4: resolution: {integrity: sha512-nUX94P84wE3gcem12g4FAH3xV7BmcCoV8FXcFVV+NIQAOwRJnyqVKhdGd9DqI4CunW+wOZhVBGKI6Jut/OlLTw==} dev: true - /fastq/1.15.0: + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true - /fflate/0.7.4: + /fflate@0.7.4: resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==} dev: true - /fill-range/7.0.1: + /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 dev: true - /flatted/3.2.7: + /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true - /fsevents/2.3.2: + /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -522,85 +533,85 @@ packages: dev: true optional: true - /get-func-name/2.0.0: + /get-func-name@2.0.0: resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} dev: true - /glob-parent/5.1.2: + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 dev: true - /is-extglob/2.1.1: + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} dev: true - /is-glob/4.0.3: + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 dev: true - /is-number/7.0.0: + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} dev: true - /js-string-escape/1.0.1: + /js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} engines: {node: '>= 0.8'} dev: true - /jsonc-parser/3.2.0: + /jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true - /local-pkg/0.4.3: + /local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} dev: true - /lodash/4.17.21: + /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /loupe/2.3.6: + /loupe@2.3.6: resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} dependencies: get-func-name: 2.0.0 dev: true - /lru-cache/6.0.0: + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} dependencies: yallist: 4.0.0 dev: true - /magic-string/0.30.0: + /magic-string@0.30.0: resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /md5-hex/3.0.1: + /md5-hex@3.0.1: resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} engines: {node: '>=8'} dependencies: blueimp-md5: 2.19.0 dev: true - /merge2/1.4.1: + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} dev: true - /micromatch/4.0.5: + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} dependencies: @@ -608,7 +619,7 @@ packages: picomatch: 2.3.1 dev: true - /mlly/1.2.0: + /mlly@1.2.0: resolution: {integrity: sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==} dependencies: acorn: 8.8.2 @@ -617,46 +628,46 @@ packages: ufo: 1.1.2 dev: true - /mrmime/1.0.1: + /mrmime@1.0.1: resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} engines: {node: '>=10'} dev: true - /ms/2.1.2: + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /nanoid/3.3.6: + /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true - /p-limit/4.0.0: + /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: yocto-queue: 1.0.0 dev: true - /pathe/1.1.0: + /pathe@1.1.0: resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} dev: true - /pathval/1.1.1: + /pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true - /picocolors/1.0.0: + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true - /picomatch/2.3.1: + /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} dev: true - /pkg-types/1.0.3: + /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 @@ -664,7 +675,7 @@ packages: pathe: 1.1.0 dev: true - /postcss/8.4.23: + /postcss@8.4.23: resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} engines: {node: ^10 || ^12 || >=14} dependencies: @@ -673,7 +684,7 @@ packages: source-map-js: 1.0.2 dev: true - /pretty-format/27.5.1: + /pretty-format@27.5.1: resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: @@ -682,20 +693,20 @@ packages: react-is: 17.0.2 dev: true - /queue-microtask/1.2.3: + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /react-is/17.0.2: + /react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true - /reusify/1.0.4: + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /rollup/3.21.5: + /rollup@3.21.5: resolution: {integrity: sha512-a4NTKS4u9PusbUJcfF4IMxuqjFzjm6ifj76P54a7cKnvVzJaG12BLVR+hgU2YDGHzyMMQNxLAZWuALsn8q2oQg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true @@ -703,13 +714,13 @@ packages: fsevents: 2.3.2 dev: true - /run-parallel/1.2.0: + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 dev: true - /semver/7.5.0: + /semver@7.5.0: resolution: {integrity: sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==} engines: {node: '>=10'} hasBin: true @@ -717,11 +728,11 @@ packages: lru-cache: 6.0.0 dev: true - /siginfo/2.0.0: + /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true - /sirv/2.0.3: + /sirv@2.0.3: resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} dependencies: @@ -730,72 +741,77 @@ packages: totalist: 3.0.1 dev: true - /source-map-js/1.0.2: + /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} dev: true - /stackback/0.0.2: + /stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /std-env/3.3.3: + /std-env@3.3.3: resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} dev: true - /strip-literal/1.0.1: + /strip-literal@1.0.1: resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} dependencies: acorn: 8.8.2 dev: true - /time-zone/1.0.0: + /time-zone@1.0.0: resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} engines: {node: '>=4'} dev: true - /tinybench/2.5.0: + /tinybench@2.5.0: resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} dev: true - /tinypool/0.5.0: + /tinypool@0.5.0: resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} engines: {node: '>=14.0.0'} dev: true - /tinyspy/2.1.0: + /tinyspy@2.1.0: resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==} engines: {node: '>=14.0.0'} dev: true - /to-regex-range/5.0.1: + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 dev: true - /totalist/3.0.1: + /toml-nodejs@0.3.0: + resolution: {integrity: sha512-xcL9y46Sl3eClQHD9hZid0AQy2YXx1UZ4xkhmxL8LOHVXczVgNbC4EmA1T+DlEgPUisWoA6d1oTswm0A8SPu/w==} + engines: {node: '>=18.16'} + dev: true + + /totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} dev: true - /type-detect/4.0.8: + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} dev: true - /typescript/5.0.4: + /typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true dev: true - /ufo/1.1.2: + /ufo@1.1.2: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /vite-node/0.31.0_@types+node@20.1.0: + /vite-node@0.31.0(@types/node@20.1.0): resolution: {integrity: sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==} engines: {node: '>=v14.18.0'} hasBin: true @@ -805,7 +821,7 @@ packages: mlly: 1.2.0 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.3.5_@types+node@20.1.0 + vite: 4.3.5(@types/node@20.1.0) transitivePeerDependencies: - '@types/node' - less @@ -816,7 +832,7 @@ packages: - terser dev: true - /vite/4.3.5_@types+node@20.1.0: + /vite@4.3.5(@types/node@20.1.0): resolution: {integrity: sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -849,7 +865,7 @@ packages: fsevents: 2.3.2 dev: true - /vitest/0.31.0_@vitest+ui@0.31.0: + /vitest@0.31.0(@vitest/ui@0.31.0): resolution: {integrity: sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -887,7 +903,7 @@ packages: '@vitest/runner': 0.31.0 '@vitest/snapshot': 0.31.0 '@vitest/spy': 0.31.0 - '@vitest/ui': 0.31.0_vitest@0.31.0 + '@vitest/ui': 0.31.0(vitest@0.31.0) '@vitest/utils': 0.31.0 acorn: 8.8.2 acorn-walk: 8.2.0 @@ -903,8 +919,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.3.5_@types+node@20.1.0 - vite-node: 0.31.0_@types+node@20.1.0 + vite: 4.3.5(@types/node@20.1.0) + vite-node: 0.31.0(@types/node@20.1.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -915,12 +931,12 @@ packages: - terser dev: true - /well-known-symbols/2.0.0: + /well-known-symbols@2.0.0: resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} engines: {node: '>=6'} dev: true - /why-is-node-running/2.2.2: + /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} hasBin: true @@ -929,11 +945,11 @@ packages: stackback: 0.0.2 dev: true - /yallist/4.0.0: + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true - /yocto-queue/1.0.0: + /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} dev: true diff --git a/src/date.ts b/src/date.ts index 821e460..2c9f0f6 100644 --- a/src/date.ts +++ b/src/date.ts @@ -31,12 +31,12 @@ type Offset = string | null -let DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?((?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?)?(Z|[-+]\d{2}:[0-5]\d)?$/i +let DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i export default class TomlDate extends Date { - #hasDate: boolean - #hasTime: boolean - #offset: Offset + #hasDate = false + #hasTime = false + #offset: Offset = null constructor (date: string | Date) { let hasDate = true @@ -52,19 +52,20 @@ export default class TomlDate extends Date { } hasTime = !!match[2] - offset = match[3] || null - date = date.toUpperCase() + // Do not allow rollover hours + if (match[2] && +match[2] > 23) { + date = '' + } else { + offset = match[3] || null + date = date.toUpperCase() + } } else { - date = 'NaN' + date = '' } } super(date) - if (isNaN(this.getTime())) { - this.#hasDate = false - this.#hasTime = false - this.#offset = null - } else { + if (!isNaN(this.getTime())) { this.#hasDate = hasDate this.#hasTime = hasTime this.#offset = offset @@ -87,6 +88,10 @@ export default class TomlDate extends Date { return this.#hasTime && !this.#hasDate } + isValid () { + return this.#hasDate || this.#hasTime + } + override toISOString() { let iso = super.toISOString() diff --git a/src/parse.ts b/src/parse.ts index f8b975d..2d32af1 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -34,9 +34,10 @@ import TomlError from './error.js' function sliceAndTrimEndOf (str: string, startPtr: number, endPtr: number, allowNewLines?: boolean): [ string, number ] { let value = str.slice(startPtr, endPtr) - let newlineIdx let commentIdx = value.indexOf('#') if (commentIdx > -1) { + // The call to skipComment allows to "validate" the comment + // (absence of control characters) skipComment(str, commentIdx) value = value.slice(0, commentIdx) } @@ -44,10 +45,8 @@ function sliceAndTrimEndOf (str: string, startPtr: number, endPtr: number, allow let trimmed = value.trimEnd() if (!allowNewLines) { - let s = '\n' - newlineIdx = value.lastIndexOf('\n') - if (newlineIdx < 0) newlineIdx = value.lastIndexOf(s = '\r') - if (trimmed.lastIndexOf(s) !== newlineIdx) { + let newlineIdx = value.indexOf('\n', trimmed.length) + if (newlineIdx > -1) { throw new TomlError('newlines are not allowed in inline tables', { toml: str, ptr: startPtr + newlineIdx diff --git a/src/primitive.ts b/src/primitive.ts index fa7466c..bb58e99 100644 --- a/src/primitive.ts +++ b/src/primitive.ts @@ -30,8 +30,7 @@ import { skipVoid } from './util.js' import TomlDate from './date.js' import TomlError from './error.js' -let DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(\d{2}:\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i -let INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(0o[0-7](_?[0-7])*)|(0b[01](_?[01])*)|[+-]?(\d(_?\d)*))$/ +let INT_REGEX = /^(((0x|0o|0b)[0-9a-fA-F](_?[0-9a-fA-F])*)|([+-]?\d(_?\d)*))$/ let FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?(e[+-]?\d(_?\d)*)?$/i let LEADING_ZERO = /^[+-]?0[0-9_]/ let ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i @@ -55,10 +54,10 @@ let VALUES_MAP = { nan: NaN, '+nan': NaN, '-nan': NaN, + // Avoid floating point representation for integer 0 '-0': 0, } - export function parseString (str: string, ptr = 0, endPtr = str.length): string { let isLiteral = str[ptr] === "'" let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1] @@ -75,14 +74,14 @@ export function parseString (str: string, ptr = 0, endPtr = str.length): string let sliceStart = ptr while (ptr < endPtr - 1) { let c = str[ptr++]! - if (!isMultiline && (c === '\n' || c === '\r')) { - throw new TomlError('newlines are not allowed in strings', { - toml: str, - ptr: ptr - 1 - }) - } - - if (c < '\t' || c === '\x0b' || c === '\x0c' || c === '\x7f' || (c > '\x0d' && c < '\x20')) { + if (c === '\n' || (c === '\r' && str[ptr] === '\n')) { + if (!isMultiline) { + throw new TomlError('newlines are not allowed in strings', { + toml: str, + ptr: ptr - 1 + }) + } + } else if ((c < '\x20' && c !== '\t') || c === '\x7f') { throw new TomlError('control characters are not allowed in strings', { toml: str, ptr: ptr - 1 @@ -156,31 +155,30 @@ export function parseValue (value: string, toml: string, ptr: number): boolean | } let numeric = +value - if (isInt && !Number.isSafeInteger(numeric)) { - throw new TomlError('integer value cannot be represented losslessly', { + if (isNaN(numeric)) { + throw new TomlError('invalid number', { toml: toml, ptr: ptr }) } - return numeric - } - - // Date - if (DATE_TIME_RE.test(value)) { - let date = new TomlDate(value) - if (isNaN(date.getTime())) { - throw new TomlError('invalid date', { + if (isInt && !Number.isSafeInteger(numeric)) { + throw new TomlError('integer value cannot be represented losslessly', { toml: toml, ptr: ptr }) } - return date + return numeric + } + + let date = new TomlDate(value) + if (!date.isValid()) { + throw new TomlError('invalid value', { + toml: toml, + ptr: ptr + }) } - throw new TomlError('invalid value', { - toml: toml, - ptr: ptr - }) + return date } diff --git a/src/struct.ts b/src/struct.ts index bf9ba2d..171babc 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -28,87 +28,83 @@ import { parseString } from './primitive.js' import { extractValue, extractKeyValue } from './parse.js' -import { type TomlPrimitive, skipComment, skipUntil, getStringEnd, skipVoid } from './util.js' +import { type TomlPrimitive, skipComment, indexOfNewline, getStringEnd, skipVoid } from './util.js' import TomlError from './error.js' let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/ export function parseKey (str: string, ptr: number, end = '='): [ string[], number ] { + let dot = ptr - 1 let parsed = [] - let c - let expectValue = ptr - while ((c = str[ptr]) !== end) { - if (c === '\n' || c === '\r') { - throw new TomlError('newlines are not allowed in keys', { - toml: str, - ptr: ptr, - }) - } + let endPtr = str.indexOf(end, ptr) + if (endPtr < 0) { + throw new TomlError('incomplete key-value: cannot find end of key', { + toml: str, + ptr: ptr + }) + } + + do { + let c = str[ptr = ++dot] + // If it's whitespace, ignore if (c !== ' ' && c !== '\t') { + // If it's a string if (c === '"' || c === "'") { - if (c === str[ptr + 1] && c === str[ptr + 2]) { - throw new TomlError('multiline strings are not allowed in keys', { + let eos = getStringEnd(str, ptr) + if (eos < 0) { + throw new TomlError('unfinished string encountered', { toml: str, ptr: ptr, }) } - let endPtr = getStringEnd(str, ptr) - if (endPtr < 0) { - throw new TomlError('incomplete string encountered in key declaration', { + dot = str.indexOf('.', eos) + let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot) + + let newLine = indexOfNewline(strEnd) + if (newLine > -1) { + throw new TomlError('newlines are not allowed in keys', { toml: str, - ptr: ptr, + ptr: ptr + dot + newLine, }) } - parsed.push(parseString(str, ptr, endPtr)) - ptr = skipVoid(str, endPtr, true, true) - if (str[ptr] !== '.' && str[ptr] !== end) { - throw new TomlError('expected next part of key (or end of key declaration)', { + if (strEnd.trimStart()) { + throw new TomlError('found extra tokens after the string part', { toml: str, - ptr: ptr, + ptr: eos, }) } - if (str[ptr] === '.') ptr++ - } else { - let endPtr = skipUntil(str, ptr, '.', end) - let part = str.slice(ptr, endPtr - +(str[endPtr] !== end)) - - if (!part) { - throw new TomlError('unexpected empty key part', { + endPtr = str.indexOf(end, eos) + if (endPtr < 0) { + throw new TomlError('incomplete key-value: cannot find end of key', { toml: str, - ptr: expectValue, + ptr: ptr, }) } + parsed.push(parseString(str, ptr, eos)) + } else { + // Normal raw key part consumption and validation + dot = str.indexOf('.', ptr) + let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot) if (!KEY_PART_RE.test(part)) { throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', { toml: str, - ptr: ptr + ptr: ptr, }) } parsed.push(part.trimEnd()) - ptr = endPtr } - - expectValue = str[ptr - 1] === '.' ? ptr - 1 : -1 - } else { - ptr++ } - } - - if (expectValue > -1) { - throw new TomlError('unexpected empty key part', { - toml: str, - ptr: expectValue, - }) - } + // Until there's no more dot + } while (dot + 1 && dot < endPtr) - return [ parsed, skipVoid(str, ptr + 1, true, true) ] + return [ parsed, skipVoid(str, endPtr + 1, true, true) ] } export function parseInlineTable (str: string, ptr: number): [ Record, number ] { @@ -119,7 +115,7 @@ export function parseInlineTable (str: string, ptr: number): [ Record '\x0d' && c < '\x20')) { + if (c === '\n') + return i + + if (c === '\r' && str[i + 1] === '\n') + return i + 1 + + if ((c < '\x20' && c !== '\t') || c === '\x7f') { throw new TomlError('control characters are not allowed in comments', { toml: str, ptr: ptr, }) } - - if (c === '\n' || c === '\r') - return i } - return -1 + return str.length } export function skipVoid (str: string, ptr: number, banNewLines?: boolean, banComments?: boolean): number { let c - while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r'))) ptr++ - - if (banComments || c !== '#') return ptr + while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r' && str[ptr + 1] === '\n'))) ptr++ - ptr = skipComment(str, ptr) - return ptr < 0 ? str.length : skipVoid(str, ptr, banNewLines) + return banComments || c !== '#' + ? ptr + : skipVoid(str, skipComment(str, ptr), banNewLines) } export function skipUntil (str: string, ptr: number, sep: string, end?: string) { diff --git a/test/toml.test.ts b/test/toml.test.ts index 2f1fc64..f8fc4a6 100644 --- a/test/toml.test.ts +++ b/test/toml.test.ts @@ -34,7 +34,6 @@ it('parses a simple key-value', () => { expect(parse('key = "value"')).toStrictEqual({ key: 'value' }) expect(parse('key = "value"\nother = 1')).toStrictEqual({ key: 'value', other: 1 }) expect(parse('key = "value"\r\nother = 1')).toStrictEqual({ key: 'value', other: 1 }) - expect(parse('key = "value"\rother = 1')).toStrictEqual({ key: 'value', other: 1 }) }) it('parses dotted key-values', () => { diff --git a/test/util.test.ts b/test/util.test.ts index e43cecf..1ced802 100644 --- a/test/util.test.ts +++ b/test/util.test.ts @@ -28,13 +28,11 @@ import { it, expect } from 'vitest' import { indexOfNewline, skipVoid, skipUntil } from '../src/util.js' -import TomlError from '../src/error.js' it('gives the index of next line', () => { expect(indexOfNewline('test\n')).toBe(4) expect(indexOfNewline('test\r\n')).toBe(4) - expect(indexOfNewline('test\ruwu\n')).toBe(4) - expect(indexOfNewline('test\ruwu\n', 5)).toBe(8) + expect(indexOfNewline('test\ruwu\n')).toBe(8) expect(indexOfNewline('test')).toBe(-1) })