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

Function jsAppendFileUint8

src/platforms/wasm/compiler/index.ts:407–416  ·  view source on GitHub ↗

* Appends Uint8Array file data to WASM module file system * @param {Object} moduleInstance - The WASM module instance * @param {string} path - File path in the virtual file system * @param {Uint8Array} blob - File data as byte array

(moduleInstance, path, blob)

Source from the content-addressed store, hash-verified

405 * @param {Uint8Array} blob - File data as byte array
406 */
407function jsAppendFileUint8(moduleInstance, path, blob) {
408 const n = moduleInstance.lengthBytesUTF8(path) + 1;
409 const path_cstr = moduleInstance._malloc(n);
410 moduleInstance.stringToUTF8(path, path_cstr, n);
411 const ptr = moduleInstance._malloc(blob.length);
412 moduleInstance.HEAPU8.set(blob, ptr);
413 jsAppendFileRaw(moduleInstance, path_cstr, ptr, blob.length);
414 moduleInstance._free(ptr);
415 moduleInstance._free(path_cstr);
416}
417
418/**
419 * Partitions files into immediate and streaming categories based on extensions

Callers 1

processFileFunction · 0.85

Calls 2

jsAppendFileRawFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected