Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@stoplight/yaml-ast-parser
Advanced tools
[![Build Status](https://travis-ci.org/mulesoft-labs/yaml-ast-parser.svg?branch=master)](https://travis-ci.org/mulesoft-labs/yaml-ast-parser)
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:
!include
tag used in RAMLThe type information below is relevant when using TypeScript, if using from JavaScript only the field/method information is relevant.
load
method can be used to load the tree and returns a YAMLNode
.
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 cast to one of the YAMLNode
descendants types:
YAMLScalar
, YAMLMapping
, YamlMap
, YAMLSequence
or YAMLAnchorReference
.class | important members |
---|---|
YAMLNode | startPosition and endPosition provide node range. |
YAMLScalar | string value field |
YAMLMapping | YAMLScalar key and YAMLNode value fields |
YAMLSequence | YAMLNode[] items field |
YamlMap | YAMLMapping[] mappings field |
YAMLAnchorReference | string referencesAnchor and YAMLNode value |
Scalars are one of the three main node types defined by YAML and are effectively leaf nodes.
There are many factors that can influence the type of datum represent in scalar node (context, schema, tag, etc.).
To help inspection of a YAMLScalar
to determine its datatype when a document uses the Core Schema, you can pass the YAMLScalar
to the determineScalarType
function. It will return an enum value indicating null
, bool
, int
, float
, or string
.
Once you know the type, there are also some helper functions to help read the value by passing them the string, value
: parseYamlBoolean
, parseYamlFloat
, and parseYamlInteger
.
FAQs
[![Build Status](https://travis-ci.org/mulesoft-labs/yaml-ast-parser.svg?branch=master)](https://travis-ci.org/mulesoft-labs/yaml-ast-parser)
The npm package @stoplight/yaml-ast-parser receives a total of 332,171 weekly downloads. As such, @stoplight/yaml-ast-parser popularity was classified as popular.
We found that @stoplight/yaml-ast-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.