Skip to content

Commit f90f47d

Browse files
dreyfus92github-actions[bot]
authored andcommitted
[ci] format
1 parent bfe0dd3 commit f90f47d

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

examples/basic/default-value.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ import color from 'picocolors';
44
async function main() {
55
const defaultPath = 'my-project';
66

7-
const result = await p.text(
8-
{
9-
message: 'Enter the directory to bootstrap the project',
10-
placeholder: ` (hit Enter to use '${defaultPath}')`,
11-
defaultValue: defaultPath,
12-
validate: (value) => {
13-
if (!value) {
14-
return 'Directory is required';
15-
}
16-
if (value.includes(' ')) {
17-
return 'Directory cannot contain spaces';
18-
}
19-
return undefined;
20-
},
21-
}
22-
);
7+
const result = await p.text({
8+
message: 'Enter the directory to bootstrap the project',
9+
placeholder: ` (hit Enter to use '${defaultPath}')`,
10+
defaultValue: defaultPath,
11+
validate: (value) => {
12+
if (!value) {
13+
return 'Directory is required';
14+
}
15+
if (value.includes(' ')) {
16+
return 'Directory cannot contain spaces';
17+
}
18+
return undefined;
19+
},
20+
});
2321

2422
if (p.isCancel(result)) {
2523
p.cancel('Operation cancelled.');

packages/core/test/prompts/text.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('TextPrompt', () => {
117117
output,
118118
render: () => 'foo',
119119
placeholder: ' (hit Enter to use default)',
120-
defaultValue: 'default-value'
120+
defaultValue: 'default-value',
121121
});
122122
const resultPromise = instance.prompt();
123123
input.emit('keypress', '', { name: 'return' });
@@ -130,7 +130,7 @@ describe('TextPrompt', () => {
130130
input,
131131
output,
132132
render: () => 'foo',
133-
placeholder: ' (hit Enter to use default)'
133+
placeholder: ' (hit Enter to use default)',
134134
});
135135
const resultPromise = instance.prompt();
136136
input.emit('keypress', '', { name: 'return' });

0 commit comments

Comments
 (0)