Skip to content

Commit

Permalink
[minor] Rename the invalidURLMessage variable
Browse files Browse the repository at this point in the history
Rename the `invalidURLMessage` variable to `invalidUrlMessage`.
  • Loading branch information
lpinca committed Sep 21, 2022
1 parent 2995349 commit 6b71a49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,19 +678,19 @@ function initAsClient(websocket, address, protocols, options) {

const isSecure = parsedUrl.protocol === 'wss:';
const isUnixSocket = parsedUrl.protocol === 'ws+unix:';
let invalidURLMessage;
let invalidUrlMessage;

if (parsedUrl.protocol !== 'ws:' && !isSecure && !isUnixSocket) {
invalidURLMessage =
invalidUrlMessage =
'The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"';
} else if (isUnixSocket && !parsedUrl.pathname) {
invalidURLMessage = "The URL's pathname is empty";
invalidUrlMessage = "The URL's pathname is empty";
} else if (parsedUrl.hash) {
invalidURLMessage = 'The URL contains a fragment identifier';
invalidUrlMessage = 'The URL contains a fragment identifier';
}

if (invalidURLMessage) {
const err = new SyntaxError(invalidURLMessage);
if (invalidUrlMessage) {
const err = new SyntaxError(invalidUrlMessage);

if (websocket._redirects === 0) {
throw err;
Expand Down

0 comments on commit 6b71a49

Please sign in to comment.