```ts
export function longWord(sentence: string): string {
  if (!sentence) return '';
  
  const words = sentence.split(/\s+/);
  let longestWord = '';

  for (const word of words) {
    if (word.length > longestWord.length) {
      longestWord = word;
    }
  }

  return longestWord;
}
```