```ts
export function oxfordJoin(names: string[]): string {
  const count = names.length;

  if (count === 0) {
    return '';
  }

  if (count === 1) {
    return names[0];
  }

  if (count === 2) {
    return `${names[0]} and ${names[1]}`;
  }

  const phrase = names.slice(0, -1).join(', ');
  return `${phrase}, and ${names[count - 1]}`;
}
```