plane
plane copied to clipboard
Support for merge keys was removed in YAML 1.2. However, this is still supported in `js-yaml`.
Support for merge keys was removed in YAML 1.2. However, this is still supported in js-yaml.
Since js-yaml aims to be YAML 1.2 compatible, it should treat << as a regular key.
Given the following script:
const yaml = require('js-yaml');
console.dir(yaml.load(`
foo: &foo
f: oo
bar:
<<: *foo
`))
Expected output:
{ foo: { f: 'oo' }, bar: { '<<': { f: 'oo' } } }
Actual output:
{ foo: { f: 'oo' }, bar: { f: 'oo' } }
I realize many people expect this to work the way as it does now, so a fix should be considered carefully, possibly in a major version release.
Originally posted by @remcohaszing in https://github.com/nodeca/js-yaml/issues/646