(blocks: readonly unknown[], chart: ChartPayload)
| 167 | } |
| 168 | |
| 169 | function hasDuplicateChart(blocks: readonly unknown[], chart: ChartPayload): boolean { |
| 170 | const signature = chartSignature(chart) |
| 171 | return blocks.some((block) => { |
| 172 | if (!isRecord(block)) return false |
| 173 | const candidate = block as BlockWithChart |
| 174 | return candidate.type === 'chart' && candidate.chart ? chartSignature(candidate.chart) === signature : false |
| 175 | }) |
| 176 | } |
| 177 | |
| 178 | export function replaceRenderOnlyToolPendingBlockWithCharts<T>( |
| 179 | blocks: readonly T[], |
no test coverage detected