The normalization cache or default empty cache if not found.
export function getTitleNormalizationCache(): TitleNormalizationCache {
try {
const cached = storage.getItem(STORAGE_KEYS.TITLE_NORMALIZATION_CACHE);
if (cached) {
const parsed = JSON.parse(cached);
console.debug(
`[Storage] 📖 Retrieved title normalization cache with ${Object.keys(parsed.caches || {}).length} algorithms`,
);
return parsed;
}
console.debug(
"[Storage] 📖 No title normalization cache found, returning empty",
);
return DEFAULT_TITLE_NORMALIZATION_CACHE;
} catch (error) {
console.error(
"[Storage] ❌ Error retrieving title normalization cache",
error,
);
return DEFAULT_TITLE_NORMALIZATION_CACHE;
}
}
Retrieves the title normalization cache from storage.