Function
parseSpec
(content: string, sourceUrl: string, provider: string)
Source from the content-addressed store, hash-verified
| 97 | }) |
| 98 | |
| 99 | const parseSpec = (content: string, sourceUrl: string, provider: string) => { |
| 100 | const isYaml = sourceUrl.endsWith(".yaml") || sourceUrl.endsWith(".yml") |
| 101 | return Effect.try({ |
| 102 | try: () => isYaml ? Yaml.parse(content) : JSON.parse(content), |
| 103 | catch: (cause) => new SpecFetchError({ provider, source: sourceUrl, cause }) |
| 104 | }) |
| 105 | } |
| 106 | |
| 107 | const fetchViaStainlessStats = Effect.fn("fetchViaStainlessStats")(function*( |
| 108 | statsUrl: string, |
Tested by
no test coverage detected