Typescript: using the "never" type

Example:

function error(message: string): never {
  throw new Error(message);
}
The "never" type is used for functions that never return a value.

Solution:

// Utilize the "never" type for functions that always throw an error or have infinite loops.

Beginner's Guide to TypeScript