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

Function parsePhaseEntry

apps/cli/internal/cli/validate.go:315–334  ·  view source on GitHub ↗
(m map[string]any)

Source from the content-addressed store, hash-verified

313}
314
315func parsePhaseEntry(m map[string]any) (validator.PhaseConfig, bool) {
316 mc := validator.PhaseConfig{}
317 if id, ok := m["id"].(string); ok {
318 mc.ID = id
319 }
320 if name, ok := m["name"].(string); ok {
321 mc.Name = name
322 }
323 if desc, ok := m["description"].(string); ok {
324 mc.Description = desc
325 }
326 if due, ok := m["due"].(string); ok {
327 ft := model.FlexibleTime{}
328 node := yaml.Node{Kind: yaml.ScalarNode, Value: due, Tag: "!!str"}
329 if err := ft.UnmarshalYAML(&node); err == nil {
330 mc.Due = ft
331 }
332 }
333 return mc, true
334}
335
336// toInt converts a viper numeric value (int, int64, float64) to int.
337func toInt(v any) int {

Callers 1

parsePhasesConfigFunction · 0.85

Calls 1

UnmarshalYAMLMethod · 0.95

Tested by

no test coverage detected