@optique/core 1.2.0-dev.2250 → 1.2.0-dev.2254

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.
@@ -155,6 +155,10 @@ function choice(choices, options = {}) {
155
155
  if (obj.maxSuggestions !== void 0 && (typeof obj.maxSuggestions !== "number" || !Number.isInteger(obj.maxSuggestions) || obj.maxSuggestions < 1)) throw new TypeError(`Expected suggest.maxSuggestions to be a positive integer, but got ${typeof obj.maxSuggestions}: ${String(obj.maxSuggestions)}.`);
156
156
  }
157
157
  }
158
+ const snapshotSuggest = typeof stringSuggest === "object" && stringSuggest !== null ? {
159
+ maxDistance: stringSuggest.maxDistance,
160
+ maxSuggestions: stringSuggest.maxSuggestions
161
+ } : stringSuggest;
158
162
  return {
159
163
  mode: "sync",
160
164
  metavar: metavar$1,
@@ -165,7 +169,7 @@ function choice(choices, options = {}) {
165
169
  const index = normalizedValues.indexOf(normalizedInput);
166
170
  if (index < 0) return {
167
171
  success: false,
168
- error: formatStringChoiceError(input, stringChoices, stringInvalidChoice, stringSuggest)
172
+ error: formatStringChoiceError(input, stringChoices, stringInvalidChoice, snapshotSuggest)
169
173
  };
170
174
  return {
171
175
  success: true,
@@ -155,6 +155,10 @@ function choice(choices, options = {}) {
155
155
  if (obj.maxSuggestions !== void 0 && (typeof obj.maxSuggestions !== "number" || !Number.isInteger(obj.maxSuggestions) || obj.maxSuggestions < 1)) throw new TypeError(`Expected suggest.maxSuggestions to be a positive integer, but got ${typeof obj.maxSuggestions}: ${String(obj.maxSuggestions)}.`);
156
156
  }
157
157
  }
158
+ const snapshotSuggest = typeof stringSuggest === "object" && stringSuggest !== null ? {
159
+ maxDistance: stringSuggest.maxDistance,
160
+ maxSuggestions: stringSuggest.maxSuggestions
161
+ } : stringSuggest;
158
162
  return {
159
163
  mode: "sync",
160
164
  metavar: metavar$1,
@@ -165,7 +169,7 @@ function choice(choices, options = {}) {
165
169
  const index = normalizedValues.indexOf(normalizedInput);
166
170
  if (index < 0) return {
167
171
  success: false,
168
- error: formatStringChoiceError(input, stringChoices, stringInvalidChoice, stringSuggest)
172
+ error: formatStringChoiceError(input, stringChoices, stringInvalidChoice, snapshotSuggest)
169
173
  };
170
174
  return {
171
175
  success: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.2.0-dev.2250",
3
+ "version": "1.2.0-dev.2254",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -216,7 +216,7 @@
216
216
  "fast-check": "^4.7.0",
217
217
  "tsdown": "^0.13.0",
218
218
  "typescript": "^5.8.3",
219
- "@optique/env": "1.2.0-dev.2250+694ee20a"
219
+ "@optique/env": "1.2.0-dev.2254+22b59099"
220
220
  },
221
221
  "scripts": {
222
222
  "build": "tsdown",