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

Function partition

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

* Partitions files into immediate and streaming categories based on extensions * @param {Array } filesJson - Array of file objects with path and data * @param {string[]} immediateExtensions - Extensions that should be loaded immediately * @returns {Array >} [immediateFiles, st

(filesJson, immediateExtensions)

Source from the content-addressed store, hash-verified

422 * @returns {Array<Array<Object>>} [immediateFiles, streamingFiles]
423 */
424function partition(filesJson, immediateExtensions) {
425 const immediateFiles = [];
426 const streamingFiles = [];
427 filesJson.map((file) => {
428 for (const ext of immediateExtensions) {
429 const pathLower = file.path.toLowerCase();
430 if (pathLower.endsWith(ext.toLowerCase())) {
431 immediateFiles.push(file);
432 return;
433 }
434 }
435 streamingFiles.push(file);
436 });
437 return [immediateFiles, streamingFiles];
438}
439
440/**
441 * Creates a file manifest JSON for the WASM module

Callers 1

fastledLoadSetupLoopFunction · 0.70

Calls 2

mapMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected