Skip to content

Commit 4285053

Browse files
committed
fix: accept string | undefined in @clack/prompts validate callbacks
1 parent edfde67 commit 4285053

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/prompts/project-create.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ async function promptSourceType(): Promise<SourceType> {
7272
async function promptUrl(): Promise<string> {
7373
const result = await p.text({
7474
message: 'Documentation URL:',
75-
validate: (value: string) => {
76-
if (!value.trim()) {
75+
validate: (value) => {
76+
if (!value?.trim()) {
7777
return 'URL is required.';
7878
}
7979

@@ -98,8 +98,8 @@ async function promptUrl(): Promise<string> {
9898
async function promptGitHub(): Promise<string> {
9999
const result = await p.text({
100100
message: 'GitHub repository (owner/repo):',
101-
validate: (value: string) => {
102-
if (!value.trim()) {
101+
validate: (value) => {
102+
if (!value?.trim()) {
103103
return 'Repository is required.';
104104
}
105105

0 commit comments

Comments
 (0)