fix(yaml-viewer): prevent large integers from being converted to exponential notation by enabling inAsBigInt config

This commit is contained in:
Link1515 2024-12-26 16:44:49 +08:00
parent 08d977b8cd
commit 0bdb04b038

View file

@ -13,7 +13,7 @@ function formatYaml({
sortKeys?: MaybeRef<boolean>
indentSize?: MaybeRef<number>
}) {
const parsedYaml = yaml.parse(get(rawYaml));
const parsedYaml = yaml.parse(get(rawYaml), { intAsBigInt: true });
const formattedYAML = yaml.stringify(parsedYaml, {
sortMapEntries: get(sortKeys),