Type guard to check if an object has a specific method
The object to check
The method name to check for
True if the object has the method as a function
Type guard to check if an object has a specific method