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

Function manifest_to_js_bootstrap

ci/compiler/asset_scanner.py:210–217  ·  view source on GitHub ↗

Produce a ``window.fastledAssetManifest = {...}`` JS snippet. Used by the WASM HTML template to inject the manifest before the FastLED runtime boots. Callers splice the returned string into a `` `` tag.

(scan: AssetScanResult)

Source from the content-addressed store, hash-verified

208
209
210def manifest_to_js_bootstrap(scan: AssetScanResult) -> str:
211 """Produce a ``window.fastledAssetManifest = {...}`` JS snippet.
212
213 Used by the WASM HTML template to inject the manifest before the FastLED
214 runtime boots. Callers splice the returned string into a ``<script>`` tag.
215 """
216 payload = json.dumps(scan.to_json_dict(), sort_keys=True)
217 return f"window.fastledAssetManifest = {payload};\n"
218
219
220def manifest_to_cpp_header(scan: AssetScanResult) -> str:

Calls 1

to_json_dictMethod · 0.80

Tested by 1