Support for merge keys was removed in YAML 1.2. However, this is still supported in `js-yaml`.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the JavaScript reproduction script from the issue and compare its actual output with the expected YAML 1.2 behavior. Inspect the js-yaml parsing path that handles the << key and determine how compatibility should be handled; done means the key is treated as a regular key without breaking existing merge-key behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100