refactor(): simplify buildUrl function

Small refactor to the $http's `buildUrl` function:
* avoid double `isObject` check
* shaves off few bytes by replacing if statement with a ternary operator