(
targets: TypedSelection[],
replaceWith: string[] | RangeGenerator
)
| 23 | } |
| 24 | |
| 25 | private getTexts( |
| 26 | targets: TypedSelection[], |
| 27 | replaceWith: string[] | RangeGenerator |
| 28 | ): string[] { |
| 29 | if (Array.isArray(replaceWith)) { |
| 30 | // Broadcast single text to each target |
| 31 | if (replaceWith.length === 1) { |
| 32 | return Array(targets.length).fill(replaceWith[0]); |
| 33 | } |
| 34 | return replaceWith; |
| 35 | } |
| 36 | const numbers = []; |
| 37 | for (let i = 0; i < targets.length; ++i) { |
| 38 | numbers[i] = (replaceWith.start + i).toString(); |
| 39 | } |
| 40 | return numbers; |
| 41 | } |
| 42 | |
| 43 | async run( |
| 44 | [targets]: [TypedSelection[]], |