@inquirer/expand 5.0.10 → 5.0.12

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 CHANGED
@@ -9,15 +9,16 @@ type Choice<Value> = {
9
9
  name: string;
10
10
  value: Value;
11
11
  };
12
- declare const _default: <Value>(config: {
12
+ declare const expand: <Value>(config: {
13
13
  message: string;
14
- choices: readonly {
14
+ choices: readonly (Separator | {
15
15
  key: Key;
16
- name: string;
17
- }[] | readonly (Separator | Choice<Value>)[];
16
+ name: Value & string;
17
+ value?: never;
18
+ } | Choice<Value>)[];
18
19
  default?: (Key | "h") | undefined;
19
20
  expanded?: boolean | undefined;
20
21
  theme?: PartialDeep<Theme> | undefined;
21
22
  }, context?: import("@inquirer/type").Context) => Promise<Value>;
22
- export default _default;
23
+ export default expand;
23
24
  export { Separator } from '@inquirer/core';
package/dist/index.js CHANGED
@@ -8,9 +8,10 @@ function normalizeChoices(choices) {
8
8
  const name = 'name' in choice ? choice.name : String(choice.value);
9
9
  const value = 'value' in choice ? choice.value : name;
10
10
  return {
11
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion
11
12
  value: value,
12
13
  name,
13
- key: choice.key.toLowerCase(),
14
+ key: choice.key,
14
15
  };
15
16
  });
16
17
  }
@@ -19,7 +20,7 @@ const helpChoice = {
19
20
  name: 'Help, list all options',
20
21
  value: undefined,
21
22
  };
22
- export default createPrompt((config, done) => {
23
+ const expand = createPrompt((config, done) => {
23
24
  const { default: defaultKey = 'h' } = config;
24
25
  const choices = useMemo(() => normalizeChoices(config.choices), [config.choices]);
25
26
  const [status, setStatus] = useState('idle');
@@ -105,4 +106,5 @@ export default createPrompt((config, done) => {
105
106
  [longChoices, helpTip, error].filter(Boolean).join('\n'),
106
107
  ];
107
108
  });
109
+ export default expand;
108
110
  export { Separator } from '@inquirer/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/expand",
3
- "version": "5.0.10",
3
+ "version": "5.0.12",
4
4
  "description": "Inquirer checkbox prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,11 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.1.7",
71
- "@inquirer/type": "^4.0.4"
70
+ "@inquirer/core": "^11.1.8",
71
+ "@inquirer/type": "^4.0.5"
72
72
  },
73
73
  "devDependencies": {
74
- "typescript": "^5.9.3"
74
+ "typescript": "^6.0.2"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@types/node": ">=18"
@@ -86,5 +86,5 @@
86
86
  },
87
87
  "main": "./dist/index.js",
88
88
  "types": "./dist/index.d.ts",
89
- "gitHead": "b218fcc4afe888a58957aa78c9a032f9bd2d60cb"
89
+ "gitHead": "979b130330e8c6f4d51f5b9915c8beae26c7e2df"
90
90
  }