Skip to content

Commit

Permalink
Moved protocol under opts merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoriani committed Jan 31, 2025
1 parent ad78551 commit ea15651
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/connect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ function connect(
parsedOptions.protocol = parsedUrl.protocol as MqttProtocol
parsedOptions.path = parsedUrl.path

parsedOptions.protocol = parsedOptions.protocol?.replace(
/:$/,
'',
) as MqttProtocol

opts = { ...parsedOptions, ...opts }

// when parsing an url expect the protocol to be set
if (!opts.protocol) {
throw new Error('Missing protocol')
}

opts.protocol = opts.protocol.replace(

Check failure on line 82 in src/lib/connect/index.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `····opts.protocol·=·opts.protocol.replace(⏎······/:$/,⏎······'',⏎····` with `↹↹opts.protocol·=·opts.protocol.replace(/:$/,·''`
/:$/,
'',
) as MqttProtocol
}

opts.unixSocket = opts.unixSocket || opts.protocol?.includes('+unix')
Expand Down

0 comments on commit ea15651

Please sign in to comment.