(value any, allowScalar bool)
| 131 | } |
| 132 | |
| 133 | func coerceStringList(value any, allowScalar bool) []string { |
| 134 | if value == nil { |
| 135 | return nil |
| 136 | } |
| 137 | if s, ok := value.(string); ok { |
| 138 | stripped := strings.TrimSpace(s) |
| 139 | if allowScalar && stripped != "" { |
| 140 | return []string{stripped} |
| 141 | } |
| 142 | return nil |
| 143 | } |
| 144 | values, ok := value.([]any) |
| 145 | if !ok { |
| 146 | return nil |
| 147 | } |
| 148 | out := make([]string, 0, len(values)) |
| 149 | for _, item := range values { |
| 150 | text, ok := item.(string) |
| 151 | if !ok || strings.TrimSpace(text) == "" { |
| 152 | return nil |
| 153 | } |
| 154 | out = append(out, strings.TrimSpace(text)) |
| 155 | } |
| 156 | return out |
| 157 | } |
| 158 | |
| 159 | func coerceBool(value any, fallback bool) bool { |
| 160 | if value == nil { |
no outgoing calls
no test coverage detected