Created
February 7, 2022 09:27
-
-
Save pmstss/f0252768f037ed68863e457d79e52d2a to your computer and use it in GitHub Desktop.
References in js-yaml serializer output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yaml = require('js-yaml'); | |
const auxObj = { | |
x: 0, | |
y: 1 | |
} | |
const obj = { | |
a: auxObj, | |
b: auxObj, | |
c: { | |
d: auxObj, | |
...auxObj | |
}, | |
e: { | |
x: 0, | |
y: 1 | |
} | |
}; | |
// a: &ref_0 | |
// x: 0 | |
// 'y': 1 | |
// b: *ref_0 | |
// c: | |
// d: *ref_0 | |
// x: 0 | |
// 'y': 1 | |
// e: | |
// x: 0 | |
// 'y': 1 | |
console.log(yaml.dump(obj)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment