main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 16 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
732 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import YamlScalar from "../nodes/YamlScalar.mjs";
|
---|
| 2 | import YamlReferenceError from "../errors/YamlReferenceError.mjs";
|
---|
| 3 | import { isAnchor } from "../nodes/predicates.mjs";
|
---|
| 4 | import { YamlStyle, YamlStyleGroup } from "../nodes/YamlStyle.mjs";
|
---|
| 5 | /* eslint-disable class-methods-use-this */
|
---|
| 6 | class ReferenceManager {
|
---|
| 7 | addAnchor(node) {
|
---|
| 8 | if (!isAnchor(node.anchor)) {
|
---|
| 9 | throw new YamlReferenceError('Expected YAML anchor to be attached the the YAML AST node.', {
|
---|
| 10 | node
|
---|
| 11 | });
|
---|
| 12 | }
|
---|
| 13 | }
|
---|
| 14 | resolveAlias(alias) {
|
---|
| 15 | return new YamlScalar({
|
---|
| 16 | content: alias.content,
|
---|
| 17 | style: YamlStyle.Plain,
|
---|
| 18 | styleGroup: YamlStyleGroup.Flow
|
---|
| 19 | });
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 | /* eslint-enable class-methods-use-this */
|
---|
| 23 |
|
---|
| 24 | export default ReferenceManager; |
---|
Note:
See
TracBrowser
for help on using the repository browser.