* Carry deterministic span identity (spanId / parentSpanId) across a block * mapping so the nesting tree survives the persist → normalize → display round * trip. Shared by both the write and read paths.
(target: T, src: { spanId?: string; parentSpanId?: string })
| 150 | * trip. Shared by both the write and read paths. |
| 151 | */ |
| 152 | function withBlockSpan<T>(target: T, src: { spanId?: string; parentSpanId?: string }): T { |
| 153 | const writable = target as { spanId?: string; parentSpanId?: string } |
| 154 | if (src.spanId) writable.spanId = src.spanId |
| 155 | if (src.parentSpanId) writable.parentSpanId = src.parentSpanId |
| 156 | return target |
| 157 | } |
| 158 | |
| 159 | function mapContentBlock(block: ContentBlock): PersistedContentBlock { |
| 160 | const persisted = mapContentBlockBody(block) |