(languages: Language[])
| 378 | * disk load (which surfaces the real error/warning path). |
| 379 | */ |
| 380 | export async function readGrammarWasmBytes(languages: Language[]): Promise<Record<string, Uint8Array>> { |
| 381 | const out: Record<string, Uint8Array> = {}; |
| 382 | const toRead = [...new Set(expandGrammarLanguages(languages))].filter( |
| 383 | (lang): lang is GrammarLanguage => lang in WASM_GRAMMAR_FILES |
| 384 | ); |
| 385 | for (const lang of toRead) { |
| 386 | try { |
| 387 | out[lang] = await fsp.readFile(resolveWasmPath(lang)); |
| 388 | } catch { |
| 389 | // fall through — the worker's own load reports the failure |
| 390 | } |
| 391 | } |
| 392 | return out; |
| 393 | } |
| 394 | |
| 395 | /** |
| 396 | * Load grammar WASM files for specific languages only. |
no test coverage detected