3
0

Extend y7s node kind checks support

This commit is contained in:
Tomaž Jerman
2023-02-15 13:54:14 +01:00
parent 8dd5dbfe65
commit ef5d87eb07

View File

@@ -6,6 +6,14 @@ import (
"gopkg.in/yaml.v3"
)
func IsSeq(n *yaml.Node) bool {
return n.Kind == yaml.SequenceNode
}
func IsMapping(n *yaml.Node) bool {
return n.Kind == yaml.MappingNode
}
func IsKind(n *yaml.Node, tt ...yaml.Kind) bool {
if n != nil {
for _, t := range tt {