ochre-sdk 0.20.27 → 0.20.28

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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -13
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3014,15 +3014,7 @@ function buildXQuery$1(params, options) {
3014
3014
  if (compiledQueryPlan.predicate.length > 0) filterPredicates.push(`(${compiledQueryPlan.predicate})`);
3015
3015
  const itemFilters = filterPredicates.length > 0 ? `[${filterPredicates.join(" and ")}]` : "";
3016
3016
  const orderedItemsClause = buildOrderedItemsClause(sort);
3017
- return `<ochre>{${`${queryFilterDeclarations}let $rawItems := ${compiledQueryPlan.itemsExpression}${itemFilters}
3018
- let $items :=
3019
- for $item at $position in $rawItems
3020
- let $itemUuid := string($item/@uuid)
3021
- where not(
3022
- some $previous in subsequence($rawItems, 1, $position - 1)
3023
- satisfies string($previous/@uuid) = $itemUuid
3024
- )
3025
- return $item
3017
+ return `<ochre>{${`${queryFilterDeclarations}let $items := ${compiledQueryPlan.itemsExpression}${itemFilters}
3026
3018
 
3027
3019
  let $totalCount := count($items)
3028
3020
  ${orderedItemsClause}
@@ -3123,10 +3115,7 @@ async function fetchSetItems(params, itemCategories, options) {
3123
3115
  items.push(...trees);
3124
3116
  }
3125
3117
  const itemsByUuid = /* @__PURE__ */ new Map();
3126
- for (const item of items) {
3127
- if (itemsByUuid.has(item.uuid)) throw new Error(`Duplicate item UUID: ${item.uuid}`);
3128
- itemsByUuid.set(item.uuid, item);
3129
- }
3118
+ for (const item of items) if (!itemsByUuid.has(item.uuid)) itemsByUuid.set(item.uuid, item);
3130
3119
  const uniqueItems = [...itemsByUuid.values()];
3131
3120
  return {
3132
3121
  totalCount: data.result.ochre.items.totalCount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.20.27",
3
+ "version": "0.20.28",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",