nodeca / js-yaml

JavaScript YAML parser and dumper. Very fast.
http://nodeca.github.io/js-yaml/
MIT License
6.28k stars 769 forks source link

export anchors(refs) #718

Open lucasyarid opened 4 months ago

lucasyarid commented 4 months ago

Is there any way I can access YAML anchors? Take this example:

shared: &shared
  - common/**/*
  - config/**/*
src:
  - *shared
  - src/**/*
backend:
  - '!(**/*.tsx|**/*.less)'

If I ran load on it, I get:

{
  shared: [ 'common/**/*', 'config/**/*' ],
  src: [ [ 'common/**/*', 'config/**/*' ], 'src/**/*' ],
  backend: [ '!(**/*.tsx|**/*.less)' ]
}

Which is expected but there is no way for me to know which of these keys are anchors or not.