MCPcopy Create free account
hub / github.com/diillson/chatcli / normalizeNodeInputs

Function normalizeNodeInputs

cli/plugins/builtin_graphview.go:381–397  ·  view source on GitHub ↗
(in []gvNodeInput)

Source from the content-addressed store, hash-verified

379}
380
381func normalizeNodeInputs(in []gvNodeInput) []GraphNode {
382 out := make([]GraphNode, 0, len(in))
383 for _, n := range in {
384 id := firstNonEmpty(n.ID, n.Label, n.Title, n.Name)
385 if id == "" {
386 continue
387 }
388 out = append(out, GraphNode{
389 ID: id,
390 Label: firstNonEmpty(n.Label, n.Title, n.Name, n.ID),
391 Kind: firstNonEmpty(n.Kind, n.Type, n.Group),
392 Summary: firstNonEmpty(n.Summary, n.Desc),
393 Weight: n.Weight,
394 })
395 }
396 return out
397}
398
399func normalizeEdgeInputs(in []gvEdgeInput) []GraphEdge {
400 out := make([]GraphEdge, 0, len(in))

Callers 2

parseGraphViewArgsFunction · 0.85
readGraphDataFileFunction · 0.85

Calls 1

firstNonEmptyFunction · 0.70

Tested by

no test coverage detected