parseMaxRunsValue parses max-runs from either integer or numeric-string frontmatter values.
(raw any)
| 28 | // parseMaxRunsValue parses max-runs from either integer or numeric-string |
| 29 | // frontmatter values. |
| 30 | func parseMaxRunsValue(raw any) int { |
| 31 | if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 { |
| 32 | return val |
| 33 | } |
| 34 | if rawStr, ok := raw.(string); ok { |
| 35 | if parsed, err := strconv.Atoi(rawStr); err == nil && parsed > 0 { |
| 36 | return parsed |
| 37 | } |
| 38 | engineLog.Printf("Ignoring invalid max-runs value: %q", rawStr) |
| 39 | } |
| 40 | return 0 |
| 41 | } |
| 42 | |
| 43 | // parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or |
| 44 | // numeric-string frontmatter values. |
no test coverage detected