export function cacheTranslation()

in src/contentScripts/functions.ts [241:253]


export function cacheTranslation(
  url: string,
  source: string,
  target: string,
  textMap: CacheTextMap
): void {
  const cache: CacheLangs = lockr.get(url, {});
  const langPair = `${source}-${target}`;
  const langPairCache = cache[langPair] ?? {};
  const updatedLangPairCache = { ...langPairCache, ...textMap };
  cache[langPair] = updatedLangPairCache;
  lockr.set(url, cache);
}