MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseSpec

Function parseSpec

packages/tools/ai-codegen/src/SpecFetcher.ts:99–105  ·  view source on GitHub ↗
(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,

Callers 1

SpecFetcher.tsFile · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected