Extend y7s node kind checks support

This commit is contained in:
Tomaž Jerman
2023-03-17 09:27:34 +01:00
parent 8dd5dbfe65
commit ef5d87eb07
+8
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 {