A small loader builds a catalog badge by market and locale, caches successful responses, and must safely expose snapshots of data to the outside. After a recent change, the panel periodically shows another badge’s text, and reusing the result changes already cached data.
loadCatalogBadge(input, fetcher) accepts an object with market and locale fields.market and locale are invalid.label and an array of strings tags.before and after in src/catalogBadge.ts.EU/en and EU/fr, where the source returns different label values.tags on the received result, then repeat the same request.ts-node or compile with tsc in strict mode.market/locale pair.tags on a previously received result must not change the value that will be returned from the cache later.22.x5.8ES modulesstrict=truenpx tsc --noEmitfetcher is an asynchronous function (market: string, locale: string) => Promise<unknown>Use line comments to explain the problem, its impact, the fix and how to test it.