ochre-sdk 0.20.18 → 0.20.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2440,11 +2440,17 @@ async function fetchSetItems(params, itemCategories, options) {
|
|
|
2440
2440
|
const trees = parseTrees(Array.isArray(data.result.ochre.items.tree) ? data.result.ochre.items.tree : [data.result.ochre.items.tree]);
|
|
2441
2441
|
items.push(...trees);
|
|
2442
2442
|
}
|
|
2443
|
+
const itemsByUuid = /* @__PURE__ */ new Map();
|
|
2444
|
+
for (const item of items) {
|
|
2445
|
+
if (itemsByUuid.has(item.uuid)) throw new Error(`Duplicate item UUID: ${item.uuid}`);
|
|
2446
|
+
itemsByUuid.set(item.uuid, item);
|
|
2447
|
+
}
|
|
2448
|
+
const uniqueItems = [...itemsByUuid.values()];
|
|
2443
2449
|
return {
|
|
2444
2450
|
totalCount: data.result.ochre.items.totalCount,
|
|
2445
2451
|
page: data.result.ochre.items.page,
|
|
2446
2452
|
pageSize: data.result.ochre.items.pageSize,
|
|
2447
|
-
items,
|
|
2453
|
+
items: uniqueItems,
|
|
2448
2454
|
error: null
|
|
2449
2455
|
};
|
|
2450
2456
|
} catch (error) {
|