@bobfrankston/mailx-store 0.1.34 → 0.1.35

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.
Files changed (2) hide show
  1. package/db.js +17 -3
  2. package/package.json +1 -1
package/db.js CHANGED
@@ -2733,9 +2733,23 @@ export class MailxDB {
2733
2733
  ftsQuery += `(${alts}) `;
2734
2734
  }
2735
2735
  else {
2736
- term = ftsClean(term);
2737
- if (term)
2738
- ftsQuery += `${term}* `;
2736
+ // Match the FTS5 unicode61 tokenizer: split on any
2737
+ // non-(letter|number|underscore) so the user's term
2738
+ // shapes the same way the index did. Without this,
2739
+ // typing "192." built "192.*" and matched nothing —
2740
+ // FTS5 had indexed "192.55.226" as the three tokens
2741
+ // 192/55/226 (Bob 2026-05-22 "type 192. it no longer
2742
+ // matches"). AND the sub-tokens (FTS5 implicit AND
2743
+ // between space-separated terms); only the LAST gets
2744
+ // a `*` so incremental typing keeps narrowing.
2745
+ const sub = ftsClean(term).split(/[^\p{L}\p{N}_]+/u).filter(Boolean);
2746
+ if (sub.length === 1) {
2747
+ ftsQuery += `${sub[0]}* `;
2748
+ }
2749
+ else if (sub.length > 1) {
2750
+ const last = sub.pop();
2751
+ ftsQuery += `${sub.join(" ")} ${last}* `;
2752
+ }
2739
2753
  }
2740
2754
  }
2741
2755
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-store",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",