diff --git a/src/utils/yaml.js b/src/utils/yaml.js index f38326dc..3ecd9fbc 100644 --- a/src/utils/yaml.js +++ b/src/utils/yaml.js @@ -18,8 +18,9 @@ import yaml from 'js-yaml'; export const getValue = (value) => { if (isObject(value)) { try { - return yaml.safeDump(value, { noRefs: true }); + return yaml.dump(value, { noRefs: true }); } catch (err) { + console.log('yaml-dump-err', err); return JSON.stringify(value, null, 2); } } diff --git a/src/utils/yaml.spec.js b/src/utils/yaml.spec.js index 7deaaa2e..61aa71d4 100644 --- a/src/utils/yaml.spec.js +++ b/src/utils/yaml.spec.js @@ -24,12 +24,9 @@ describe('test yaml', () => { }, }, }) - ).toBe(`{ - "level1": { - "level2": { - "key": "value" - } - } -}`); + ).toBe(`level1: + level2: + key: value +`); }); });