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

Function parseNormalizedStringArrayStrict

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

Source from the content-addressed store, hash-verified

261}
262
263func parseNormalizedStringArrayStrict(value any) ([]string, bool) {
264 arr, ok := value.([]any)
265 if !ok {
266 return nil, false
267 }
268 result := make([]string, 0, len(arr))
269 for _, item := range arr {
270 s, ok := item.(string)
271 if !ok {
272 return nil, false
273 }
274 if normalized := normalizePackageName(s); normalized != "" {
275 result = append(result, normalized)
276 }
277 }
278 return result, true
279}
280
281func parseNormalizedStringMapStrict(value any) (map[string]string, bool) {
282 result := map[string]string{}

Callers 1

ParseFromPluginsFunction · 0.85

Calls 1

normalizePackageNameFunction · 0.85

Tested by

no test coverage detected