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

Function parseOverrideOptions

etscore/options_parser.go:340–380  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

338}
339
340func parseOverrideOptions(value any) OverrideOptions {
341 result := OverrideOptions{}
342 optionsMap, ok := asStringAnyMap(value)
343 if !ok {
344 return result
345 }
346
347 if value, exists := optionsMap("diagnosticSeverity"); exists {
348 result.DiagnosticSeverity = parseDiagnosticSeverityMap(value)
349 }
350
351 if value, exists := optionsMap("pipeableMinArgCount"); exists {
352 if f, ok := value.(float64); ok {
353 parsed := int(f)
354 result.PipeableMinArgCount = &parsed
355 }
356 }
357 if value, exists := optionsMap("keyPatterns"); exists {
358 if arr, ok := value.([]any); ok {
359 parsed := parseKeyPatterns(arr)
360 result.KeyPatterns = &parsed
361 }
362 }
363 if value, exists := optionsMap("extendedKeyDetection"); exists {
364 if b, ok := value.(bool); ok {
365 result.ExtendedKeyDetection = &b
366 }
367 }
368 if value, exists := optionsMap("allowedDuplicatedPackages"); exists {
369 if pkgs, ok := parseStringArrayStrict(value); ok {
370 result.AllowedDuplicatedPackages = &pkgs
371 }
372 }
373 if value, exists := optionsMap("effectFn"); exists {
374 if variants, ok := parseStringArrayStrict(value); ok {
375 result.EffectFn = &variants
376 }
377 }
378
379 return result
380}
381
382func parseStringArrayStrict(value any) ([]string, bool) {
383 arr, ok := value.([]any)

Callers 1

parseOverridesFunction · 0.85

Calls 4

asStringAnyMapFunction · 0.85
parseKeyPatternsFunction · 0.85
parseStringArrayStrictFunction · 0.85

Tested by

no test coverage detected