@getlupa/client 0.7.0-alpha-9 → 0.7.0-alpha-12

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.
@@ -12026,7 +12026,13 @@ const parseParam = (key, params) => {
12026
12026
  if (!value) {
12027
12027
  return undefined;
12028
12028
  }
12029
- return decodeURIComponent(value);
12029
+ try {
12030
+ return decodeURIComponent(value);
12031
+ }
12032
+ catch (_a) {
12033
+ // Invalid parameter, possibly out of LupaSearch plugin scope, return undefined
12034
+ return undefined;
12035
+ }
12030
12036
  };
12031
12037
  const parseRegularKeys = (regularKeys, searchParams) => {
12032
12038
  const params = Object.create({});
@@ -12156,7 +12162,10 @@ const generateResultLink = (link, searchText, facet) => {
12156
12162
  const getRelativePath = (link) => {
12157
12163
  try {
12158
12164
  const url = new URL(link);
12159
- return url.toString().substring(url.origin.length);
12165
+ const partialUrl = url.toString().substring(url.origin.length);
12166
+ return partialUrl.endsWith("/")
12167
+ ? partialUrl.slice(0, partialUrl.length - 1)
12168
+ : partialUrl;
12160
12169
  }
12161
12170
  catch (_a) {
12162
12171
  // Invalid url, let's return original string
@@ -16765,7 +16774,6 @@ __vue_render__$A._withStripped = true;
16765
16774
  let SearchResultGeneratedBadge = class SearchResultGeneratedBadge extends Vue$1 {
16766
16775
  get image() {
16767
16776
  var _a, _b, _c;
16768
- console.log(this.badge.titleText);
16769
16777
  return (_c = (_b = (_a = this.options.generate) === null || _a === void 0 ? void 0 : _a.image) === null || _b === void 0 ? void 0 : _b.call(_a, this.badge)) !== null && _c !== void 0 ? _c : "";
16770
16778
  }
16771
16779
  };
@@ -16865,7 +16873,9 @@ let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$
16865
16873
  this.badgeField.length > 0);
16866
16874
  }
16867
16875
  get badges() {
16868
- return this.badgeField.map((f) => ({
16876
+ return this.badgeField
16877
+ .filter((f) => Boolean(f))
16878
+ .map((f) => ({
16869
16879
  backgroundColor: this.keyMap.backgroundColor
16870
16880
  ? f[this.keyMap.backgroundColor]
16871
16881
  : undefined,
@@ -16875,7 +16885,8 @@ let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$
16875
16885
  ? f[this.keyMap.additionalText]
16876
16886
  : undefined,
16877
16887
  id: this.keyMap.id ? f[this.keyMap.id] : undefined,
16878
- }));
16888
+ }))
16889
+ .filter((b) => Boolean(b.id));
16879
16890
  }
16880
16891
  };
16881
16892
  __decorate([
@@ -12022,7 +12022,13 @@ const parseParam = (key, params) => {
12022
12022
  if (!value) {
12023
12023
  return undefined;
12024
12024
  }
12025
- return decodeURIComponent(value);
12025
+ try {
12026
+ return decodeURIComponent(value);
12027
+ }
12028
+ catch (_a) {
12029
+ // Invalid parameter, possibly out of LupaSearch plugin scope, return undefined
12030
+ return undefined;
12031
+ }
12026
12032
  };
12027
12033
  const parseRegularKeys = (regularKeys, searchParams) => {
12028
12034
  const params = Object.create({});
@@ -12152,7 +12158,10 @@ const generateResultLink = (link, searchText, facet) => {
12152
12158
  const getRelativePath = (link) => {
12153
12159
  try {
12154
12160
  const url = new URL(link);
12155
- return url.toString().substring(url.origin.length);
12161
+ const partialUrl = url.toString().substring(url.origin.length);
12162
+ return partialUrl.endsWith("/")
12163
+ ? partialUrl.slice(0, partialUrl.length - 1)
12164
+ : partialUrl;
12156
12165
  }
12157
12166
  catch (_a) {
12158
12167
  // Invalid url, let's return original string
@@ -16761,7 +16770,6 @@ __vue_render__$A._withStripped = true;
16761
16770
  let SearchResultGeneratedBadge = class SearchResultGeneratedBadge extends Vue$1 {
16762
16771
  get image() {
16763
16772
  var _a, _b, _c;
16764
- console.log(this.badge.titleText);
16765
16773
  return (_c = (_b = (_a = this.options.generate) === null || _a === void 0 ? void 0 : _a.image) === null || _b === void 0 ? void 0 : _b.call(_a, this.badge)) !== null && _c !== void 0 ? _c : "";
16766
16774
  }
16767
16775
  };
@@ -16861,7 +16869,9 @@ let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$
16861
16869
  this.badgeField.length > 0);
16862
16870
  }
16863
16871
  get badges() {
16864
- return this.badgeField.map((f) => ({
16872
+ return this.badgeField
16873
+ .filter((f) => Boolean(f))
16874
+ .map((f) => ({
16865
16875
  backgroundColor: this.keyMap.backgroundColor
16866
16876
  ? f[this.keyMap.backgroundColor]
16867
16877
  : undefined,
@@ -16871,7 +16881,8 @@ let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$
16871
16881
  ? f[this.keyMap.additionalText]
16872
16882
  : undefined,
16873
16883
  id: this.keyMap.id ? f[this.keyMap.id] : undefined,
16874
- }));
16884
+ }))
16885
+ .filter((b) => Boolean(b.id));
16875
16886
  }
16876
16887
  };
16877
16888
  __decorate([