MCPcopy Create free account
hub / github.com/driangle/taskmd / parsePhasesConfig

Function parsePhasesConfig

apps/cli/internal/cli/validate.go:292–313  ·  view source on GitHub ↗

parsePhasesConfig converts raw viper phases data into typed PhaseConfig entries.

(raw any)

Source from the content-addressed store, hash-verified

290
291// parsePhasesConfig converts raw viper phases data into typed PhaseConfig entries.
292func parsePhasesConfig(raw any) []validator.PhaseConfig {
293 if raw == nil {
294 return nil
295 }
296 items, ok := raw.([]any)
297 if !ok {
298 return nil
299 }
300
301 phases := make([]validator.PhaseConfig, 0, len(items))
302 for _, item := range items {
303 m, ok := item.(map[string]any)
304 if !ok {
305 continue
306 }
307 mc, valid := parsePhaseEntry(m)
308 if valid {
309 phases = append(phases, mc)
310 }
311 }
312 return phases
313}
314
315func parsePhaseEntry(m map[string]any) (validator.PhaseConfig, bool) {
316 mc := validator.PhaseConfig{}

Calls 1

parsePhaseEntryFunction · 0.85