code: function getDefaultPortFromScheme( scheme ) {
    var port = null;
    if ( scheme === 'ftp') {
      port = 21;
    }
    else if ( scheme === 'gopher' ) {
      port = 70;
    }
    else if ( scheme === 'http' || scheme === 'ws' ) {
      port = 80;
    }
    else if ( scheme === 'https' || scheme === 'wss' ) {
      port = 443;
    }
    return port;
  }
docs: https://url.spec.whatwg.org/#url-miscellaneous