Kind
The kind
operator identifies the type of a node as either scalar
, map
, or seq
.
This can be used for filtering or transforming nodes based on their type.
Note that null
values are treated as scalar
.
Get kind
Given a sample.yml file of:
then
will output
Get kind, ignores custom tags
Unlike tag, kind is not affected by custom tags.
Given a sample.yml file of:
then
will output
Add comments only to scalars
An example of how you can use kind
Given a sample.yml file of:
then
will output
Last updated