RangeMap iterates over the map and calls the provided function for each key-value pair. If the function returns false, the iteration will stop.
(node *yaml.Node, fn func(key, val *yaml.Node) bool)
| 47 | // RangeMap iterates over the map and calls the provided function for each key-value pair. If the |
| 48 | // function returns false, the iteration will stop. |
| 49 | func (yc YAMLHelper) RangeMap(node *yaml.Node, fn func(key, val *yaml.Node) bool) { |
| 50 | if !yc.IsMap(node) { |
| 51 | return |
| 52 | } |
| 53 | for i := 0; i < len(node.Content); i += 2 { |
| 54 | key, val := normalizeEntry(node.Content, i) |
| 55 | if !fn(key, val) { |
| 56 | break |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // IsString returns true if the YAML node is a string. |
| 62 | func (YAMLHelper) IsString(node *yaml.Node) bool { |