(code: string, lang: string, themes: Themes)
| 36 | }); |
| 37 | |
| 38 | function cacheKey(code: string, lang: string, themes: Themes) { |
| 39 | const prefix = code.slice(0, 100); |
| 40 | const suffix = code.length > 100 ? code.slice(-100) : ""; |
| 41 | return `${lang}:${themes[0]}:${themes[1]}:${code.length}:${prefix}:${suffix}`; |
| 42 | } |
| 43 | |
| 44 | function themeName(t: unknown): string { |
| 45 | if (typeof t === "string") return t; |