ok keep it with the `if (typeof ...)`. I still think doing overloading in JS is a bad idea (since the language has no native support for this) but I won't fight for this and this is probably not a place where performance will matter.