MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / yamlMappingValue

Function yamlMappingValue

internal/pluginhost/config.go:141–151  ·  view source on GitHub ↗
(node *yaml.Node, key string)

Source from the content-addressed store, hash-verified

139}
140
141func yamlMappingValue(node *yaml.Node, key string) *yaml.Node {
142 if node == nil || node.Kind != yaml.MappingNode {
143 return nil
144 }
145 for index := 0; index+1 < len(node.Content); index += 2 {
146 if node.Content[index] != nil && node.Content[index].Value == key {
147 return node.Content[index+1]
148 }
149 }
150 return nil
151}
152
153func normalizedConfigNode(item config.PluginInstanceConfig, enabled bool) *yaml.Node {
154 if item.Raw.Kind == 0 {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected