makeplane / makeplane/plane

Support for merge keys was removed in YAML 1.2. However, this is still supported in `js-yaml`.

Open
#8,499 1 comment 0 reactions 0 assignees View on GitHub

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.

See changes in version 1.2

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.