diff --git a/src/tools/yaml-viewer/composeverter.d.ts b/src/tools/yaml-viewer/composeverter.d.ts index 44b6303e..eda6f43f 100644 --- a/src/tools/yaml-viewer/composeverter.d.ts +++ b/src/tools/yaml-viewer/composeverter.d.ts @@ -17,4 +17,5 @@ declare module 'composeverter' { export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string; export function getDockerComposeSchemaWithoutFormats(): object; export function yamlParse(content: string): object; + export function yamlCheck(content: string): object; } \ No newline at end of file diff --git a/src/tools/yaml-viewer/yaml-models.ts b/src/tools/yaml-viewer/yaml-models.ts index 9167fd7a..83726815 100644 --- a/src/tools/yaml-viewer/yaml-models.ts +++ b/src/tools/yaml-viewer/yaml-models.ts @@ -1,5 +1,5 @@ import { type MaybeRef, get } from '@vueuse/core'; -import { yamlParse } from 'composeverter'; +import { yamlCheck } from 'composeverter'; import yaml from 'yaml'; export { formatYaml }; @@ -13,7 +13,9 @@ function formatYaml({ sortKeys?: MaybeRef indentSize?: MaybeRef }) { - const parsedYaml = yamlParse(get(rawYaml)); + const rawYamlString = get(rawYaml); + yamlCheck(rawYamlString); + const parsedYaml = yaml.parse(rawYamlString, { intAsBigInt: true }); const formattedYAML = yaml.stringify(parsedYaml, { sortMapEntries: get(sortKeys),