* This method does not insert spaces if there is none in the original string.
(host: Host)
| 63 | * This method does not insert spaces if there is none in the original string. |
| 64 | */ |
| 65 | apply(host: Host): Promise<void> { |
| 66 | return host.read(this.path).then((content) => { |
| 67 | const prefix = content.substring(0, this.pos); |
| 68 | const suffix = content.substring(this.pos); |
| 69 | |
| 70 | return host.write(this.path, `${prefix}${this.toAdd}${suffix}`); |
| 71 | }); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |