MCPcopy Index your code
hub / github.com/jvilk/BrowserFS / _makeFile

Method _makeFile

src/backend/HTML5FS.ts:469–473  ·  view source on GitHub ↗

* Returns a BrowserFS object representing a File.

(path: string, entry: FileEntry, flag: FileFlag, stat: File, data: ArrayBuffer = new ArrayBuffer(0))

Source from the content-addressed store, hash-verified

467 * Returns a BrowserFS object representing a File.
468 */
469 private _makeFile(path: string, entry: FileEntry, flag: FileFlag, stat: File, data: ArrayBuffer = new ArrayBuffer(0)): HTML5FSFile {
470 const stats = new Stats(FileType.FILE, stat.size);
471 const buffer = arrayBuffer2Buffer(data);
472 return new HTML5FSFile(this, entry, path, flag, stats, buffer);
473 }
474
475 /**
476 * Returns an array of `FileEntry`s. Used internally by empty and readdir.

Callers 1

openMethod · 0.95

Calls 1

arrayBuffer2BufferFunction · 0.90

Tested by

no test coverage detected