MCPcopy
hub / github.com/jvilk/BrowserFS / sync

Method sync

src/backend/Dropbox.ts:319–332  ·  view source on GitHub ↗
(cb: BFSOneArgCallback)

Source from the content-addressed store, hash-verified

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);

Callers 1

closeMethod · 0.95

Calls 7

buffer2ArrayBufferFunction · 0.90
cbFunction · 0.85
isDirtyMethod · 0.80
getBufferMethod · 0.80
_writeFileStrictMethod · 0.80
getPathMethod · 0.80
resetDirtyMethod · 0.80

Tested by

no test coverage detected