@forcecalendar/core 2.1.39 → 2.1.40

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.
@@ -358,11 +358,18 @@ export class EventSearch {
358
358
  if (normalizedValue.includes(term)) {
359
359
  totalScore += 10;
360
360
  }
361
- // Fuzzy match if enabled
361
+ // Fuzzy match if enabled — compare against individual words
362
362
  else if (fuzzy) {
363
- const distance = this.levenshteinDistance(term, normalizedValue);
364
- if (distance <= 2) {
365
- totalScore += 5 - distance;
363
+ const words = normalizedValue.split(/\s+/);
364
+ let bestDistance = Infinity;
365
+ for (const word of words) {
366
+ const distance = this.levenshteinDistance(term, word);
367
+ if (distance < bestDistance) {
368
+ bestDistance = distance;
369
+ }
370
+ }
371
+ if (bestDistance <= 2) {
372
+ totalScore += 5 - bestDistance;
366
373
  }
367
374
  }
368
375
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.39",
3
+ "version": "2.1.40",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",