@searchspring/snap-client 0.61.4 → 0.62.0

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.
@@ -75,7 +75,7 @@ transformSearchResponse.result = function (rawResult) {
75
75
  var attributes = Object.keys(rawResult)
76
76
  .filter(function (k) { return CORE_FIELDS.indexOf(k) == -1; })
77
77
  // remove 'badges' from attributes - but only if it is an object
78
- .filter(function (k) { return !(k == 'badges' && typeof rawResult[k] == 'object'); })
78
+ .filter(function (k) { return !(k == 'badges' && typeof rawResult[k] == 'object' && !Array.isArray(rawResult[k])); })
79
79
  .reduce(function (attributes, key) {
80
80
  var _a;
81
81
  return __assign(__assign({}, attributes), (_a = {}, _a[key] = decodeProperty(rawResult[key] || ''), _a));
@@ -94,7 +94,7 @@ transformSearchResponse.result = function (rawResult) {
94
94
  core: coreFieldValues,
95
95
  },
96
96
  attributes: attributes,
97
- badges: typeof rawResult.badges == 'object' ? rawResult.badges : [],
97
+ badges: typeof rawResult.badges == 'object' && !Array.isArray(rawResult.badges) ? rawResult.badges : [],
98
98
  children: children,
99
99
  });
100
100
  };
@@ -68,7 +68,7 @@ transformSearchResponse.result = (rawResult) => {
68
68
  const attributes = Object.keys(rawResult)
69
69
  .filter((k) => CORE_FIELDS.indexOf(k) == -1)
70
70
  // remove 'badges' from attributes - but only if it is an object
71
- .filter((k) => !(k == 'badges' && typeof rawResult[k] == 'object'))
71
+ .filter((k) => !(k == 'badges' && typeof rawResult[k] == 'object' && !Array.isArray(rawResult[k])))
72
72
  .reduce((attributes, key) => {
73
73
  return {
74
74
  ...attributes,
@@ -93,7 +93,7 @@ transformSearchResponse.result = (rawResult) => {
93
93
  core: coreFieldValues,
94
94
  },
95
95
  attributes,
96
- badges: typeof rawResult.badges == 'object' ? rawResult.badges : [],
96
+ badges: typeof rawResult.badges == 'object' && !Array.isArray(rawResult.badges) ? rawResult.badges : [],
97
97
  children,
98
98
  });
99
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchspring/snap-client",
3
- "version": "0.61.4",
3
+ "version": "0.62.0",
4
4
  "description": "Snap Client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -20,12 +20,12 @@
20
20
  "test:watch": "jest --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@searchspring/snap-toolbox": "^0.61.4",
23
+ "@searchspring/snap-toolbox": "^0.62.0",
24
24
  "deepmerge": "4.3.1"
25
25
  },
26
26
  "sideEffects": false,
27
27
  "files": [
28
28
  "dist/**/*"
29
29
  ],
30
- "gitHead": "13e39b72deb62eb103e39729201de494903969c1"
30
+ "gitHead": "2c9561e8b0097a44c5587bc5629068b06041385f"
31
31
  }