It's a very long line. Let's split it. And it's better tot use ```slice``` to chop the last char.
```
var scheme = urlobj.protocol.slice(0, -1) || 'http';
var port = urlobj.port || urlobj.protocol === 'https' ? 443 : 80;
return new JSONRPCClient(scheme, urlobj.hostname, port, urlobj.path);
```