@riboseinc/anafero-cli 0.0.64 → 0.0.65

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.
package/bootstrap.js CHANGED
@@ -109633,7 +109633,8 @@ schema (${ast._tag}): ${ast}`;
109633
109633
  const [debouncedQuery] = a(query.text, 200);
109634
109634
  const [showMore, setShowMore] = (0, import_react204.useState)(false);
109635
109635
  const [matches2, error] = (0, import_react204.useMemo)(() => {
109636
- if (index && debouncedQuery.trim() !== "") {
109636
+ const debouncedQueryTrimmed = debouncedQuery.trim();
109637
+ if (index && debouncedQueryTrimmed !== "") {
109637
109638
  const normalizedQuery = preprocessStringForIndexing(
109638
109639
  debouncedQuery.replace(/:/g, " ").replace(/\*/g, " ")
109639
109640
  );
@@ -109660,9 +109661,13 @@ schema (${ast._tag}): ${ast}`;
109660
109661
  });
109661
109662
  }
109662
109663
  }) ?? []).slice(0, MAX_SEARCH_RESULT_COUNT) : [];
109664
+ const wildcardLeading = debouncedQueryTrimmed.startsWith("*") ?? void 0;
109665
+ const wildcardTrailing = debouncedQueryTrimmed.endsWith("*") ?? void 0;
109666
+ const wildcard = wildcardLeading && wildcardTrailing ? import_lunr.default.Query.wildcard.LEADING | import_lunr.default.Query.wildcard.TRAILING : wildcardLeading ? import_lunr.default.Query.wildcard.LEADING : wildcardTrailing ? import_lunr.default.Query.wildcard.TRAILING : import_lunr.default.Query.wildcard.NONE;
109663
109667
  const partial5 = exact.length < 1 && full.length < 1 || showMore ? (index.query((query2) => {
109664
109668
  query2.term(tokens, {
109665
- presence: import_lunr.default.Query.presence.OPTIONAL
109669
+ presence: import_lunr.default.Query.presence.OPTIONAL,
109670
+ wildcard
109666
109671
  });
109667
109672
  }) ?? []).slice(0, MAX_SEARCH_RESULT_COUNT) : [];
109668
109673
  return [{ exact, full, partial: partial5 }, null];
@@ -110966,7 +110971,6 @@ schema (${ast._tag}): ${ast}`;
110966
110971
  ))) {
110967
110972
  delete pageMap2[key];
110968
110973
  }
110969
- console.debug("Page map", pageMap2, resourceMap);
110970
110974
  return pageMap2;
110971
110975
  },
110972
110976
  [resourceMap]