@inquirer/rawlist 5.3.7 → 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.
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ type RawlistConfig<Value> = {
|
|
|
21
21
|
};
|
|
22
22
|
declare const _default: <const Value>(config: {
|
|
23
23
|
message: string;
|
|
24
|
-
choices: readonly (
|
|
25
|
-
loop?: boolean
|
|
26
|
-
theme?: PartialDeep<Theme<RawlistTheme
|
|
24
|
+
choices: readonly (Value | Choice<Value> | Separator)[];
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
theme?: PartialDeep<Theme<RawlistTheme>>;
|
|
27
27
|
default?: NoInfer<Value> | undefined;
|
|
28
28
|
} & RawlistConfig<Value>, context?: import("@inquirer/type").Context) => Promise<Value>;
|
|
29
29
|
export default _default;
|
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 =
|
|
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(
|
|
45
|
-
const answer = Number.parseInt(
|
|
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
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Inquirer rawlist prompt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"yo",
|
|
42
42
|
"zsh"
|
|
43
43
|
],
|
|
44
|
-
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/
|
|
44
|
+
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/HEAD/packages/rawlist/README.md",
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"author": "Simon Boudrias <admin@simonboudrias.com>",
|
|
47
47
|
"repository": {
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"tsc": "tsc"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@inquirer/core": "^12.0
|
|
71
|
-
"@inquirer/type": "4.
|
|
70
|
+
"@inquirer/core": "^12.1.0",
|
|
71
|
+
"@inquirer/type": "4.3.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@repo/tsconfig": "0.
|
|
75
|
-
"typescript": "^
|
|
74
|
+
"@repo/tsconfig": "0.1.0",
|
|
75
|
+
"typescript": "^7.0.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@types/node": ">=18"
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
|
-
"node": "
|
|
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": "
|
|
90
|
+
"gitHead": "00ded073f80523aaeaf8a903bbfb535994990475"
|
|
91
91
|
}
|