gdc-common-utils-ts 2.6.3 → 2.6.4

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.
@@ -39,6 +39,7 @@ export function extractBundleSearchResources(value) {
39
39
  const entries = candidate.data.map(record).filter(isRecord);
40
40
  if (entries.length === 0)
41
41
  return [];
42
+ let recognizedSearchEnvelope = false;
42
43
  const resources = entries.flatMap((entry) => {
43
44
  const resource = record(entry.resource);
44
45
  if (!resource)
@@ -46,10 +47,14 @@ export function extractBundleSearchResources(value) {
46
47
  const legacyRows = resource.total !== undefined && Array.isArray(resource.data)
47
48
  ? resource.data.map(record).filter(isRecord)
48
49
  : undefined;
50
+ if (legacyRows)
51
+ recognizedSearchEnvelope = true;
49
52
  return legacyRows ?? [resource];
50
53
  });
51
54
  if (resources.length > 0)
52
55
  return resources;
56
+ if (recognizedSearchEnvelope)
57
+ return [];
53
58
  // Compatibility for older SDK fixtures that passed already-extracted rows.
54
59
  return entries;
55
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },