(cb: BFSOneArgCallback)
| 317 | } |
| 318 | |
| 319 | public sync(cb: BFSOneArgCallback): void { |
| 320 | if (this.isDirty()) { |
| 321 | const buffer = this.getBuffer(), |
| 322 | arrayBuffer = buffer2ArrayBuffer(buffer); |
| 323 | this._fs._writeFileStrict(this.getPath(), arrayBuffer, (e?: ApiError) => { |
| 324 | if (!e) { |
| 325 | this.resetDirty(); |
| 326 | } |
| 327 | cb(e); |
| 328 | }); |
| 329 | } else { |
| 330 | cb(); |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | public close(cb: BFSOneArgCallback): void { |
| 335 | this.sync(cb); |
no test coverage detected