@reactionary/meilisearch 0.10.17 → 0.10.19

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.
@@ -63,13 +63,14 @@ class MeilisearchProductSearchCapability extends ProductSearchCapability {
63
63
  }
64
64
  if (payload.personalizationProfile) {
65
65
  let blurb = payload.personalizationProfile.blurb || "";
66
- if (blurb.length > 500) {
67
- blurb = blurb.substring(0, 500);
68
- }
69
- if (!blurb) {
70
- blurb = "The customer is in the following segments: " + payload.personalizationProfile.segments.join(", ");
71
- }
72
- if (blurb) {
66
+ const segments = payload.personalizationProfile.segments || [];
67
+ if (blurb || segments.length > 0) {
68
+ if (blurb.length > 500) {
69
+ blurb = blurb.substring(0, 500);
70
+ }
71
+ if (!blurb) {
72
+ blurb = "The customer is in the following segments: " + segments.join(", ");
73
+ }
73
74
  searchOptions.personalize = {
74
75
  userContext: blurb
75
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/meilisearch",
3
- "version": "0.10.17",
3
+ "version": "0.10.19",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/Solteq/reactionary.git"
10
10
  },
11
11
  "dependencies": {
12
- "@reactionary/core": "0.10.17",
12
+ "@reactionary/core": "0.10.19",
13
13
  "zod": "4.1.9",
14
14
  "meilisearch": "^0.58.0"
15
15
  },