(name, seen)
| 451 | const cache = new Map() |
| 452 | |
| 453 | function mergedFields(name, seen) { |
| 454 | if (cache.has(name)) return cache.get(name) |
| 455 | const def = defMap.get(name) |
| 456 | if (!isRecordGroup(def) || isDispatchType(def) || seen.has(name)) return null |
| 457 | seen.add(name) |
| 458 | const fields = [] |
| 459 | for (const prop of def.Properties.flat()) { |
| 460 | if (!prop || typeof prop !== 'object') continue |
| 461 | const entry = typeList(prop.Type)[0] |
| 462 | const isSpread = !prop.Name && isGroupRef(entry) |
| 463 | const composed = isSpread ? mergedFields(entry.Value, seen) : null |
| 464 | if (composed) fields.push(...structuredClone(composed)) |
| 465 | else fields.push(prop) |
| 466 | } |
| 467 | seen.delete(name) |
| 468 | cache.set(name, fields) |
| 469 | return fields |
| 470 | } |
| 471 | |
| 472 | for (const def of out) { |
| 473 | if (!isRecordGroup(def) || isDispatchType(def)) continue |
no test coverage detected