Skip to content

Commit e7eceb9

Browse files
committed
fix(@inquirer/editor): Fix typo s/waitForUseInput/waitForUserInput
1 parent afd1e22 commit e7eceb9

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

packages/demo/src/demos/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const demo = async () => {
2121
await editor({
2222
message: 'Automatically opened editor',
2323
default: '# This prompt was automatically opened. You can write anything:\n\n',
24-
waitForUseInput: false,
24+
waitForUserInput: false,
2525
}),
2626
);
2727
};

packages/editor/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ const answer = await editor({
7272

7373
## Options
7474

75-
| Property | Type | Required | Description |
76-
| --------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77-
| message | `string` | yes | The question to ask |
78-
| default | `string` | no | Default value which will automatically be present in the editor |
79-
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
80-
| postfix | `string` | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors. |
81-
| file | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file. |
82-
| waitForUseInput | `boolean` | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |
83-
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |
75+
| Property | Type | Required | Description |
76+
| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77+
| message | `string` | yes | The question to ask |
78+
| default | `string` | no | Default value which will automatically be present in the editor |
79+
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
80+
| postfix | `string` | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors. |
81+
| file | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file. |
82+
| waitForUserInput | `boolean` | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |
83+
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |
8484

8585
## Theming
8686

packages/editor/editor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('editor prompt', () => {
4545
it('open editor immediately', async () => {
4646
const { answer, getScreen } = await render(editor, {
4747
message: 'Add a description',
48-
waitForUseInput: false,
48+
waitForUserInput: false,
4949
});
5050
expect(editAsync).toHaveBeenLastCalledWith('', expect.any(Function), {
5151
postfix: '.txt',

packages/editor/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ type EditorConfig = {
2424
message: string;
2525
default?: string;
2626
postfix?: string;
27-
waitForUseInput?: boolean;
27+
waitForUserInput?: boolean;
2828
validate?: (value: string) => boolean | string | Promise<string | boolean>;
2929
file?: IFileOptions;
3030
theme?: PartialDeep<Theme<EditorTheme>>;
3131
};
3232

3333
export default createPrompt<string, EditorConfig>((config, done) => {
3434
const {
35-
waitForUseInput = true,
35+
waitForUserInput = true,
3636
file: { postfix = config.postfix ?? '.txt', ...fileProps } = {},
3737
validate = () => true,
3838
} = config;
@@ -79,7 +79,7 @@ export default createPrompt<string, EditorConfig>((config, done) => {
7979
}
8080

8181
useEffect((rl) => {
82-
if (!waitForUseInput) {
82+
if (!waitForUserInput) {
8383
startEditor(rl);
8484
}
8585
}, []);

packages/inquirer/examples/editor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ const answers = await inquirer.prompt([
1616

1717
return true;
1818
},
19-
waitForUseInput: true,
19+
waitForUserInput: true,
2020
},
2121
{
2222
type: 'editor',
2323
name: 'edition',
2424
message: 'Edit the following content.',
2525
default: 'Hello, World!',
26-
waitForUseInput: false,
26+
waitForUserInput: false,
2727
},
2828
] satisfies DistinctQuestion[]);
2929

0 commit comments

Comments
 (0)