JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5634668
  • Score
    100M100P100Q265382F
  • License Apache-2.0

Package Exports

  • yaml-ast-parser
  • yaml-ast-parser/dist/schema
  • yaml-ast-parser/dist/schema/default_safe
  • yaml-ast-parser/dist/type
  • yaml-ast-parser/dist/type/js/regexp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yaml-ast-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

yaml-ast-parser

Build Status

This is a fork of JS-YAML which supports parsing of YAML into AST.

In additional to parsing YAML to AST, it has following features:

  • restoration after the errors and reporting errors as a part of AST nodes.
  • built-in support for !include tag used in RAML

load method can be used to load the tree and returns YAMLNode root.

YAMLNode class is an ancestor for all node kinds. It's kind field determine node kind, one of Kind enum: SCALAR, MAPPING, MAP, SEQ, ANCHOR_REF or INCLUDE_REF. After node kind is determined, it can be casted to one of the YAMLNode descendants: YAMLScalar, YAMLMapping, YamlMap, YAMLSequence or YAMLAnchorReference.

startPosition and endPosition of YAMLNode class provide node range.

YAMLScalar has string value field.

YAMLMapping has YAMLScalar key and YAMLNode value fields.

YAMLSequence has YAMLNode[] items field.

YamlMap has YAMLMapping[] mappings field.

YAMLAnchorReference has string referencesAnchor and YAMLNode value.