(
range: CodeRange,
code: string,
duration?: number,
)
| 202 | duration: number, |
| 203 | ): ThreadGenerator; |
| 204 | public replace( |
| 205 | range: CodeRange, |
| 206 | code: string, |
| 207 | duration?: number, |
| 208 | ): TOwner | ThreadGenerator { |
| 209 | if (duration === undefined) { |
| 210 | const current = this.get(); |
| 211 | const [fragments, index] = extractRange(range, current.fragments); |
| 212 | fragments[index] = code; |
| 213 | return this.set({ |
| 214 | progress: current.progress, |
| 215 | fragments, |
| 216 | }); |
| 217 | } else { |
| 218 | return this.replaceTween(range, code, duration); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | private *replaceTween(range: CodeRange, code: string, duration: number) { |
| 223 | let current = this.get(); |
no test coverage detected