Files
klz-cables.com/.pnpm-store/v10/files/a8/4af672ca46046366ad5cfe466511350dcfc0bf2ee7c8dcf2d0804717e1a238ff923cb87dc14a9518cf1676878469b516d5df1eab166277bd69420fc973bfc1
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

23 lines
765 B
Plaintext

/**
* If there is an incoming row id,
* and it matches the existing sibling doc id,
* this is an existing row, so it should be merged.
* Otherwise, return an empty object.
*/ export const getExistingRowDoc = (incomingRow, existingRows)=>{
if (incomingRow.id && Array.isArray(existingRows)) {
const matchedExistingRow = existingRows.find((existingRow)=>{
if (typeof existingRow === 'object' && 'id' in existingRow) {
if (existingRow.id === incomingRow.id) {
return existingRow;
}
}
return false;
});
if (matchedExistingRow) {
return matchedExistingRow;
}
}
return {};
};
//# sourceMappingURL=getExistingRowDoc.js.map