MCPcopy Create free account
hub / github.com/FastLED/FastLED / processFile

Function processFile

src/platforms/wasm/compiler/index.ts:751–768  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

749 * @param {number} file.size - File size in bytes
750 */
751 const processFile = async (file) => {
752 try {
753 const response = await fetch(file.path);
754 const reader = response.body.getReader();
755
756 console.log(`File fetched: ${file.path}, size: ${file.size}`);
757
758 while (true) {
759 // deno-lint-ignore no-await-in-loop
760 const { value, done } = await reader.read();
761 if (done) break;
762 // Allocate and copy chunk data
763 jsAppendFileUint8(moduleInstance, file.path, value);
764 }
765 } catch (error) {
766 console.error(`Error processing file ${file.path}:`, error);
767 }
768 };
769
770 /**
771 * Fetches all files in parallel and calls completion callback

Callers 1

fetchAllFilesFunction · 0.85

Calls 5

jsAppendFileUint8Function · 0.85
fetchFunction · 0.50
logMethod · 0.45
readMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected