MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / parseDiagnosticSeverityMap

Function parseDiagnosticSeverityMap

etscore/options_parser.go:427–444  ·  view source on GitHub ↗

parseDiagnosticSeverityMap converts a plugin rule configuration map to map[string]Severity.

(value any)

Source from the content-addressed store, hash-verified

425
426// parseDiagnosticSeverityMap converts a plugin rule configuration map to map[string]Severity.
427func parseDiagnosticSeverityMap(value any) map[string]Severity {
428 result := make(map[string]Severity)
429 switch m := value.(type) {
430 case *collections.OrderedMap[string, any]:
431 for k, v := range m.Entries() {
432 if s, ok := v.(string); ok {
433 result[k] = ParseSeverity(s)
434 }
435 }
436 case map[string]any:
437 for k, v := range m {
438 if s, ok := v.(string); ok {
439 result[k] = ParseSeverity(s)
440 }
441 }
442 }
443 return result
444}
445
446// parseKeyPatterns converts a JSON array of key pattern objects to []KeyPattern.
447func parseKeyPatterns(arr []any) []KeyPattern {

Callers 2

ParseFromPluginsFunction · 0.85
parseOverrideOptionsFunction · 0.85

Calls 1

ParseSeverityFunction · 0.85

Tested by

no test coverage detected