@inquirer/select 2.1.1 → 2.2.1
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/cjs/index.js +1 -1
- package/dist/esm/index.mjs +2 -2
- package/package.json +7 -6
package/dist/cjs/index.js
CHANGED
|
@@ -28,7 +28,7 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
28
28
|
// TODO: Replace with `findLastIndex` when it's available.
|
|
29
29
|
const last = items.length - 1 - [...items].reverse().findIndex(isSelectable);
|
|
30
30
|
if (first < 0)
|
|
31
|
-
throw new
|
|
31
|
+
throw new core_1.ValidationError('[select prompt] No selectable choices. All choices are disabled.');
|
|
32
32
|
return { first, last };
|
|
33
33
|
}, [items]);
|
|
34
34
|
const defaultItemIndex = (0, core_1.useMemo)(() => {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, isBackspaceKey, isEnterKey, isUpKey, isDownKey, isNumberKey, Separator, makeTheme, } from '@inquirer/core';
|
|
1
|
+
import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, isBackspaceKey, isEnterKey, isUpKey, isDownKey, isNumberKey, Separator, ValidationError, makeTheme, } from '@inquirer/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import figures from 'figures';
|
|
4
4
|
import ansiEscapes from 'ansi-escapes';
|
|
@@ -21,7 +21,7 @@ export default createPrompt((config, done) => {
|
|
|
21
21
|
// TODO: Replace with `findLastIndex` when it's available.
|
|
22
22
|
const last = items.length - 1 - [...items].reverse().findIndex(isSelectable);
|
|
23
23
|
if (first < 0)
|
|
24
|
-
throw new
|
|
24
|
+
throw new ValidationError('[select prompt] No selectable choices. All choices are disabled.');
|
|
25
25
|
return { first, last };
|
|
26
26
|
}, [items]);
|
|
27
27
|
const defaultItemIndex = useMemo(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/select",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Inquirer select/list prompt",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"typings": "./dist/cjs/types/index.d.ts",
|
|
@@ -54,19 +54,20 @@
|
|
|
54
54
|
"license": "MIT",
|
|
55
55
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/README.md",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@inquirer/core": "^7.
|
|
58
|
-
"@inquirer/type": "^1.2.
|
|
57
|
+
"@inquirer/core": "^7.1.1",
|
|
58
|
+
"@inquirer/type": "^1.2.1",
|
|
59
59
|
"ansi-escapes": "^4.3.2",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
61
|
"figures": "^3.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@inquirer/testing": "^2.1.
|
|
64
|
+
"@inquirer/testing": "^2.1.14"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
|
|
68
68
|
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
|
|
69
|
-
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs"
|
|
69
|
+
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
|
|
70
|
+
"attw": "attw --pack"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public"
|
|
@@ -86,5 +87,5 @@
|
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "086fb1c59092cba248e55583d92f34e4eec44b2d"
|
|
90
91
|
}
|