code: function checkTypeOf(variable, expectedType) {
      // @ts-ignore
      expectedType = expectedType.toLowerCase();
      if (typeof variable !== expectedType)
          throw new Error('Input must be ' + expectedType);
  }
docs: Remember: typeof null does not return 'null'.  It returns 'object'.