From d291cc1492b52c54a7fc069838931cba9bcb2e0c Mon Sep 17 00:00:00 2001 From: "Brennan Wilkes (Text Groove)" Date: Sat, 31 Jan 2026 18:26:52 -0800 Subject: [PATCH] fix: SKU map tool --- tools/dedupe_skulinks.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/dedupe_skulinks.js b/tools/dedupe_skulinks.js index 7dbca67..f30af10 100644 --- a/tools/dedupe_skulinks.js +++ b/tools/dedupe_skulinks.js @@ -37,11 +37,12 @@ let prunedAuto = 0; let prunedDup = 0; const seen = new Set(); // dedupe after normalization - const nextLinks = []; + for (const x of Array.isArray(linksData.links) ? linksData.links : []) { const a = normalizeImplicitSkuKey(x?.fromSku); const b = normalizeImplicitSkuKey(x?.toSku); + if (!a || !b) { prunedMissing++; continue; @@ -67,7 +68,12 @@ for (const x of Array.isArray(linksData.links) ? linksData.links : []) { } seen.add(key); - nextLinks.push({ fromSku: a, toSku: b }); + // preserve datestamps/metadata; just normalize the SKUs + nextLinks.push({ + ...x, + fromSku: a, + toSku: b, + }); } linksData.links = nextLinks;