@riboseinc/anafero-cli 0.0.30 → 0.0.31

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
@@ -130317,12 +130317,18 @@ var Search2 = function({ index, selected, onSelect, query, getPlainTitle, locate
130317
130317
  const tokens = import_lunr.default.tokenizer(debouncedQuery.replace(/:/g, " "));
130318
130318
  console.debug("Search: tokens", tokens);
130319
130319
  try {
130320
- const exact = (index.query((query2) => {
130321
- query2.term(debouncedQuery, {
130322
- presence: import_lunr.default.Query.presence.REQUIRED,
130323
- wildcard: import_lunr.default.Query.wildcard.LEADING | import_lunr.default.Query.wildcard.TRAILING
130324
- });
130325
- }) ?? []).slice(0, MAX_SEARCH_RESULT_COUNT);
130320
+ let exact;
130321
+ try {
130322
+ exact = (index.query((query2) => {
130323
+ query2.term(debouncedQuery, {
130324
+ presence: import_lunr.default.Query.presence.REQUIRED,
130325
+ wildcard: import_lunr.default.Query.wildcard.LEADING | import_lunr.default.Query.wildcard.TRAILING
130326
+ });
130327
+ }) ?? []).slice(0, MAX_SEARCH_RESULT_COUNT);
130328
+ } catch (e2) {
130329
+ exact = [];
130330
+ console.error("Failed exact search", e2);
130331
+ }
130326
130332
  const full = exact.length < 1 || showMore ? (index.query((query2) => {
130327
130333
  query2.term(tokens, {
130328
130334
  presence: import_lunr.default.Query.presence.REQUIRED
@@ -130336,7 +130342,8 @@ var Search2 = function({ index, selected, onSelect, query, getPlainTitle, locate
130336
130342
  }) ?? []).slice(0, MAX_SEARCH_RESULT_COUNT) : [];
130337
130343
  return [{ exact, full, partial: partial5 }, null];
130338
130344
  } catch (e2) {
130339
- return [{ exact: [], full: [], partial: [] }, `${e2.message}`];
130345
+ console.error(e2);
130346
+ return [{ exact: [], full: [], partial: [] }, "Sorry, something went wrong"];
130340
130347
  }
130341
130348
  } else {
130342
130349
  return [{ exact: [], full: [], partial: [] }, null];