```ts
export function digitWord(digit: number): string {
  if (digit < 0 || digit > 9) throw new Error(`Invalid digit: ${digit}`);
  return ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'][digit];
}

export function digitWords(digits: string): string {
  if (!digits || typeof digits !== 'string') throw new Error(`Invalid input: ${digits}`);
  return [...digits].map(digitWord).join(' ');
}
```