@inquirer/expand 5.1.5 → 5.1.7

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/README.md CHANGED
@@ -9,46 +9,116 @@ Compact single select prompt. Every option is assigned a shortcut key, and selec
9
9
 
10
10
  <table>
11
11
  <tr>
12
- <th>npm</th>
13
12
  <th>yarn</th>
13
+ <th>pnpm</th>
14
14
  </tr>
15
15
  <tr>
16
16
  <td>
17
17
 
18
18
  ```sh
19
- npm install @inquirer/prompts
19
+ yarn add @inquirer/prompts
20
20
  ```
21
21
 
22
22
  </td>
23
23
  <td>
24
24
 
25
25
  ```sh
26
- yarn add @inquirer/prompts
26
+ pnpm add @inquirer/prompts
27
27
  ```
28
28
 
29
29
  </td>
30
30
  </tr>
31
31
  <tr>
32
- <td colSpan="2" align="center">Or</td>
32
+ <th>bun</th>
33
+ <th>deno</th>
33
34
  </tr>
34
35
  <tr>
35
36
  <td>
36
37
 
37
38
  ```sh
38
- npm install @inquirer/expand
39
+ bun add @inquirer/prompts
39
40
  ```
40
41
 
41
42
  </td>
42
43
  <td>
43
44
 
45
+ ```sh
46
+ deno add npm:@inquirer/prompts
47
+ ```
48
+
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <th colSpan="2">npm</th>
53
+ </tr>
54
+ <tr>
55
+ <td colSpan="2">
56
+
57
+ ```sh
58
+ npm install @inquirer/prompts
59
+ ```
60
+
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td colSpan="2" align="center">Or</td>
65
+ </tr>
66
+ <tr>
67
+ <th>yarn</th>
68
+ <th>pnpm</th>
69
+ </tr>
70
+ <tr>
71
+ <td>
72
+
44
73
  ```sh
45
74
  yarn add @inquirer/expand
46
75
  ```
47
76
 
77
+ </td>
78
+ <td>
79
+
80
+ ```sh
81
+ pnpm add @inquirer/expand
82
+ ```
83
+
84
+ </td>
85
+ </tr>
86
+ <tr>
87
+ <th>bun</th>
88
+ <th>deno</th>
89
+ </tr>
90
+ <tr>
91
+ <td>
92
+
93
+ ```sh
94
+ bun add @inquirer/expand
95
+ ```
96
+
97
+ </td>
98
+ <td>
99
+
100
+ ```sh
101
+ deno add npm:@inquirer/expand
102
+ ```
103
+
104
+ </td>
105
+ </tr>
106
+ <tr>
107
+ <th colSpan="2">npm</th>
108
+ </tr>
109
+ <tr>
110
+ <td colSpan="2">
111
+
112
+ ```sh
113
+ npm install @inquirer/expand
114
+ ```
115
+
48
116
  </td>
49
117
  </tr>
50
118
  </table>
51
119
 
120
+ On Deno, prompts detect the terminal's unicode and color support from the environment, so run your script with `--allow-env`.
121
+
52
122
  # Usage
53
123
 
54
124
  ```js
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ const expand = createPrompt((config, done) => {
31
31
  const prefix = usePrefix({ theme, status });
32
32
  useKeypress((event, rl) => {
33
33
  if (isEnterKey(event)) {
34
- const answer = (value || defaultKey).toLowerCase();
34
+ const answer = (value.trim() || defaultKey).toLowerCase();
35
35
  if (answer === 'h' && !expanded) {
36
36
  setExpanded(true);
37
37
  }
@@ -85,7 +85,7 @@ const expand = createPrompt((config, done) => {
85
85
  return ` ${choice.separator}`;
86
86
  }
87
87
  const line = ` ${choice.key}) ${choice.name}`;
88
- if (choice.key === value.toLowerCase()) {
88
+ if (choice.key === value.trim().toLowerCase()) {
89
89
  return theme.style.highlight(line);
90
90
  }
91
91
  return line;
@@ -93,7 +93,7 @@ const expand = createPrompt((config, done) => {
93
93
  .join('\n');
94
94
  }
95
95
  let helpTip = '';
96
- const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase());
96
+ const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.trim().toLowerCase());
97
97
  if (currentOption) {
98
98
  helpTip = `${styleText('cyan', '>>')} ${currentOption.name}`;
99
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/expand",
3
- "version": "5.1.5",
3
+ "version": "5.1.7",
4
4
  "description": "Inquirer checkbox prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,8 +67,8 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^12.0.3",
71
- "@inquirer/type": "4.1.1"
70
+ "@inquirer/core": "^12.0.5",
71
+ "@inquirer/type": "4.2.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@repo/tsconfig": "0.0.0",
@@ -87,5 +87,5 @@
87
87
  },
88
88
  "main": "./dist/index.js",
89
89
  "types": "./dist/index.d.ts",
90
- "gitHead": "cbdb34bfc6c245941d80ef88493c50b3d6dbfce6"
90
+ "gitHead": "ea3130ebc609a6a3910b5397244044de7eda3d05"
91
91
  }