diff --git a/src/greet.ts b/src/greet.ts index 08c455b..81a51a8 100755 --- a/src/greet.ts +++ b/src/greet.ts @@ -1,3 +1,6 @@ export function greet(name: string): string { - return `Hi, ${name}!`; + if (!name || name.trim().length === 0) { + throw new Error("Name cannot be empty"); + } + return `Hello, ${name}!`; }