getString safely extracts a string value from a map
(m map[string]any, key string)
| 716 | |
| 717 | // getString safely extracts a string value from a map |
| 718 | func getString(m map[string]any, key string) string { |
| 719 | if val, ok := m[key].(string); ok { |
| 720 | return val |
| 721 | } |
| 722 | return "" |
| 723 | } |
| 724 | |
| 725 | // ensureSingleSelectOptionBefore ensures an option exists before a specific option |
| 726 | // If beforeName is not found in the options list, the desired option is appended to the end |