MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / looksLikeTableHeader

Function looksLikeTableHeader

internal/metadata/catalog.go:127–142  ·  view source on GitHub ↗
(header, separator string)

Source from the content-addressed store, hash-verified

125}
126
127func looksLikeTableHeader(header, separator string) bool {
128 if !strings.Contains(header, "|") || !strings.Contains(separator, "|") {
129 return false
130 }
131 for _, cell := range splitTableRow(separator) {
132 trimmed := strings.TrimSpace(cell)
133 if trimmed == "" {
134 continue
135 }
136 trimmed = strings.Trim(trimmed, ":")
137 if len(trimmed) >= 3 && strings.Trim(trimmed, "-") == "" {
138 return true
139 }
140 }
141 return false
142}
143
144func catalogColumnIndexes(header []string, kind entities.Kind) (nameIdx, descIdx int, ok bool) {
145 nameIdx = -1

Callers 1

parseCatalogMarkdownFunction · 0.85

Calls 1

splitTableRowFunction · 0.85

Tested by

no test coverage detected