MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / fileToObjectUrl

Function fileToObjectUrl

src/pages/markdownPreview/index.js:188–195  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

186}
187
188async function fileToObjectUrl(file) {
189 const fs = fsOperation(file);
190 const fileInfo = await fs.stat();
191 const binData = await fs.readFile();
192 return URL.createObjectURL(
193 new Blob([binData], { type: fileInfo.mime || "application/octet-stream" }),
194 );
195}
196
197function revokeObjectUrls(urls) {
198 urls.forEach((url) => {

Callers 1

resolveRenderedImagesFunction · 0.85

Calls 3

fsOperationFunction · 0.85
statMethod · 0.45
readFileMethod · 0.45

Tested by

no test coverage detected