@inquirer/select 5.1.2 → 5.1.3

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/dist/index.js +3 -1
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -73,8 +73,10 @@ export default createPrompt((config, done) => {
73
73
  return items.findIndex((item) => isSelectable(item) && item.value === config.default);
74
74
  }, [config.default, items]);
75
75
  const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
76
- // Safe to assume the cursor position always point to a Choice.
77
76
  const selectedChoice = items[active];
77
+ if (selectedChoice == null || Separator.isSeparator(selectedChoice)) {
78
+ throw new Error('Active index does not point to a choice');
79
+ }
78
80
  const [errorMsg, setError] = useState();
79
81
  useKeypress((key, rl) => {
80
82
  clearTimeout(searchTimeoutRef.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/select",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Inquirer select/list prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,13 +67,13 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/ansi": "^2.0.4",
71
- "@inquirer/core": "^11.1.7",
72
- "@inquirer/figures": "^2.0.4",
73
- "@inquirer/type": "^4.0.4"
70
+ "@inquirer/ansi": "^2.0.5",
71
+ "@inquirer/core": "^11.1.8",
72
+ "@inquirer/figures": "^2.0.5",
73
+ "@inquirer/type": "^4.0.5"
74
74
  },
75
75
  "devDependencies": {
76
- "typescript": "^5.9.3"
76
+ "typescript": "^6.0.2"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@types/node": ">=18"
@@ -88,5 +88,5 @@
88
88
  },
89
89
  "main": "./dist/index.js",
90
90
  "types": "./dist/index.d.ts",
91
- "gitHead": "b218fcc4afe888a58957aa78c9a032f9bd2d60cb"
91
+ "gitHead": "e68fe01d65359e083581c48c4a18cd8f97d88842"
92
92
  }