| 228 | ) |
| 229 | |
| 230 | const 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 |