• Persists the in-memory manga cache to localStorage. Safely handles errors if localStorage is unavailable (e.g., in Node.js environments).

    Returns void

    export function saveCache(): void {
    if (globalThis.window !== undefined) {
    try {
    localStorage.setItem(MANGA_CACHE_KEY, JSON.stringify(mangaCache));
    } catch (e) {
    console.error(
    "[MangaSearchService] Error saving cache to localStorage:",
    e,
    );
    }
    }
    }