()
| 102 | let normalizedMaxSpan = Math.max(minSpan, maxSpan); |
| 103 | |
| 104 | const emit = (): void => { |
| 105 | const next: ZoomRange = { start, end }; |
| 106 | if ( |
| 107 | lastEmitted !== null && |
| 108 | lastEmitted.start === next.start && |
| 109 | lastEmitted.end === next.end |
| 110 | ) { |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | lastEmitted = copyRange(next); |
| 115 | |
| 116 | // Emit to a snapshot so additions/removals during emit don't affect this flush. |
| 117 | const snapshot = Array.from(listeners); |
| 118 | for (const cb of snapshot) cb({ start, end }); |
| 119 | }; |
| 120 | |
| 121 | const toAnchor = (nextStart: number, nextEnd: number, spec?: ZoomRangeAnchor): { readonly center: number; readonly ratio: number } | undefined => { |
| 122 | if (!spec) return undefined; |
no test coverage detected