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

Function normalizeEdgeInputs

cli/plugins/builtin_graphview.go:399–410  ·  view source on GitHub ↗
(in []gvEdgeInput)

Source from the content-addressed store, hash-verified

397}
398
399func normalizeEdgeInputs(in []gvEdgeInput) []GraphEdge {
400 out := make([]GraphEdge, 0, len(in))
401 for _, e := range in {
402 s := firstNonEmpty(e.Source, e.From)
403 t := firstNonEmpty(e.Target, e.To)
404 if s == "" || t == "" {
405 continue
406 }
407 out = append(out, GraphEdge{Source: s, Target: t, Weight: e.Weight})
408 }
409 return out
410}
411
412func finalizeGraphViewArgs(out graphViewArgs) (graphViewArgs, error) {
413 out.Source = strings.ToLower(strings.TrimSpace(out.Source))

Callers 2

parseGraphViewArgsFunction · 0.85
readGraphDataFileFunction · 0.85

Calls 1

firstNonEmptyFunction · 0.70

Tested by

no test coverage detected