(name, seen)
| 434 | const cache = new Map() |
| 435 | |
| 436 | function mergedFields(name, seen) { |
| 437 | if (cache.has(name)) return cache.get(name) |
| 438 | const def = defMap.get(name) |
| 439 | if (!isRecordGroup(def) || isDispatchType(def) || seen.has(name)) return null |
| 440 | seen.add(name) |
| 441 | const fields = [] |
| 442 | for (const prop of def.Properties.flat()) { |
| 443 | if (!prop || typeof prop !== 'object') continue |
| 444 | const entry = typeList(prop.Type)[0] |
| 445 | const isSpread = !prop.Name && isGroupRef(entry) |
| 446 | const composed = isSpread ? mergedFields(entry.Value, seen) : null |
| 447 | if (composed) fields.push(...structuredClone(composed)) |
| 448 | else fields.push(prop) |
| 449 | } |
| 450 | seen.delete(name) |
| 451 | cache.set(name, fields) |
| 452 | return fields |
| 453 | } |
| 454 | |
| 455 | for (const def of out) { |
| 456 | if (!isRecordGroup(def) || isDispatchType(def)) continue |
no test coverage detected