ochre-sdk 0.20.26 → 0.20.27

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 +9 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3014,7 +3014,15 @@ 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 $items := ${compiledQueryPlan.itemsExpression}${itemFilters}
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
3018
3026
 
3019
3027
  let $totalCount := count($items)
3020
3028
  ${orderedItemsClause}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.20.26",
3
+ "version": "0.20.27",
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",