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

Function cloneOpenAPISpec

packages/effect/src/unstable/httpapi/OpenApi.ts:230–242  ·  view source on GitHub ↗
(value: A)

Source from the content-addressed store, hash-verified

228 )
229
230const cloneOpenAPISpec = <A>(value: A): A => {
231 if (Array.isArray(value)) {
232 return value.map(cloneOpenAPISpec) as A
233 }
234 if (value !== null && typeof value === "object") {
235 const out: Record<string, unknown> = {}
236 for (const key of Object.keys(value)) {
237 InternalRecord.assignProperty(out, key, cloneOpenAPISpec((value as Record<string, unknown>)[key]))
238 }
239 return out as A
240 }
241 return value
242}
243
244/**
245 * This function checks if a given tag exists within the provided context. If

Callers 1

fromApiWithFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected