(filePath: string)
| 134 | } |
| 135 | |
| 136 | async function getCachedBlob(filePath: string): Promise<Blob> { |
| 137 | const cached = fileBlobCache.get(filePath); |
| 138 | if (cached) return cached; |
| 139 | |
| 140 | const blob = await loadFileAsBlob(filePath); |
| 141 | |
| 142 | if (fileBlobCache.size >= MAX_CACHE_SIZE) { |
| 143 | const firstKey = fileBlobCache.keys().next().value; |
| 144 | if (firstKey) fileBlobCache.delete(firstKey); |
| 145 | } |
| 146 | fileBlobCache.set(filePath, blob); |
| 147 | return blob; |
| 148 | } |
| 149 | |
| 150 | function getTTSSegmentIdentity( |
| 151 | segment: { text?: string | null; cfi?: string | null } | null | undefined, |
no test coverage detected