@optique/core 1.0.0-dev.1495 → 1.0.0-dev.1499

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.
@@ -81,8 +81,11 @@ function findSimilar(input, candidates, options = {}) {
81
81
  if (input.length === 0) return [];
82
82
  const normalizedInput = caseSensitive ? input : input.toLowerCase();
83
83
  const matches = [];
84
+ const seen = /* @__PURE__ */ new Set();
84
85
  for (const candidate of candidates) {
85
86
  const normalizedCandidate = caseSensitive ? candidate : candidate.toLowerCase();
87
+ if (seen.has(candidate)) continue;
88
+ seen.add(candidate);
86
89
  const distance = levenshteinDistance(normalizedInput, normalizedCandidate);
87
90
  if (distance === 0) return [candidate];
88
91
  const distanceRatio = distance / input.length;
@@ -81,8 +81,11 @@ function findSimilar(input, candidates, options = {}) {
81
81
  if (input.length === 0) return [];
82
82
  const normalizedInput = caseSensitive ? input : input.toLowerCase();
83
83
  const matches = [];
84
+ const seen = /* @__PURE__ */ new Set();
84
85
  for (const candidate of candidates) {
85
86
  const normalizedCandidate = caseSensitive ? candidate : candidate.toLowerCase();
87
+ if (seen.has(candidate)) continue;
88
+ seen.add(candidate);
86
89
  const distance = levenshteinDistance(normalizedInput, normalizedCandidate);
87
90
  if (distance === 0) return [candidate];
88
91
  const distanceRatio = distance / input.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1495+f6fe8a79",
3
+ "version": "1.0.0-dev.1499+1fd447f6",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",