```ts
/** Returns the quotient of two finite numbers. Throws an Error if either argument is not a number or the divisor is zero. */
export function safeDivide(a: number, b: number): number {
  if (typeof a !== 'number' || typeof b !== 'number') {
    throw new Error('Both arguments must be numbers');
  }
  
  if (!isFinite(b)) { // check for NaN
    throw new Error(`Cannot divide by zero or infinity`);
  } else if (b === 0) {
    throw new Error('Divisor cannot be zero');
  }
  
  return a / b;
}
```