@inquirer/rawlist 5.3.8 → 5.4.0

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 -3
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createPrompt, useMemo, useState, useKeypress, usePrefix, isDownKey, isEnterKey, isUpKey, Separator, makeTheme, ValidationError, } from '@inquirer/core';
2
2
  import { styleText } from 'node:util';
3
- const numberRegex = /\d+/;
3
+ const numberRegex = /^\d+$/;
4
4
  const rawlistTheme = {
5
5
  style: {
6
6
  description: (text) => styleText('cyan', text),
@@ -41,8 +41,8 @@ function getSelectedChoice(input, choices) {
41
41
  const trimmedInput = input.trim();
42
42
  selectedChoice = selectableChoices.find((choice) => choice.key === input || choice.key === trimmedInput);
43
43
  // If no custom key match and input is numeric, try 1-based index
44
- if (!selectedChoice && numberRegex.test(input)) {
45
- const answer = Number.parseInt(input, 10) - 1;
44
+ if (!selectedChoice && numberRegex.test(trimmedInput)) {
45
+ const answer = Number.parseInt(trimmedInput, 10) - 1;
46
46
  selectedChoice = selectableChoices[answer];
47
47
  }
48
48
  return selectedChoice
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/rawlist",
3
- "version": "5.3.8",
3
+ "version": "5.4.0",
4
4
  "description": "Inquirer rawlist prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,11 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^12.0.6",
71
- "@inquirer/type": "4.2.1"
70
+ "@inquirer/core": "^12.1.0",
71
+ "@inquirer/type": "4.3.0"
72
72
  },
73
73
  "devDependencies": {
74
- "@repo/tsconfig": "0.0.0",
74
+ "@repo/tsconfig": "0.1.0",
75
75
  "typescript": "^7.0.2"
76
76
  },
77
77
  "peerDependencies": {
@@ -83,9 +83,9 @@
83
83
  }
84
84
  },
85
85
  "engines": {
86
- "node": ">=23.5.0 || ^22.13.0 || ^20.17.0"
86
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
87
87
  },
88
88
  "main": "./dist/index.js",
89
89
  "types": "./dist/index.d.ts",
90
- "gitHead": "672b77f0486388d7f5c35487d89a5ff63f4c54dd"
90
+ "gitHead": "00ded073f80523aaeaf8a903bbfb535994990475"
91
91
  }