Map of md5 exclusion key → entry, or {} when absent.
const excluded = await getExcludedProducts();
// => { "a1b2c3…": { url: "https://…", supplier: "Loudwolf",
// title: "Acetone 500ml", excludedAt: 1713301200000 } }
if (excluded[key]) {
// product is on the ignore list
}
export async function getExcludedProducts(): Promise<ExcludedProductsMap> {
try {
const db = await getDB();
const record = await db.get(IDB_STORE.EXCLUDED_PRODUCTS, 'current');
return record?.map ?? {};
} catch (error) {
logger.error('Failed to get excluded products from IndexedDB', { error });
return {};
}
}
Load the user's excluded-products map from the
excludedProductsobject store. The whole map lives under a single row keyed by"current"(same single-row pattern used bysearchResults), so this is a single read. Returns{}when the store is empty or the read fails, letting callers treat the result as always-valid without null-checking.