File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,11 @@ import { cleanSocket, getSocketAddress } from 'get-port-please'
66
77export function formatSocketURL ( socketPath : string , ssl = false ) : string {
88 const protocol = ssl ? 'https' : 'http'
9- if ( process . platform === 'win32' ) {
10- // Windows named pipes need special encoding
11- const encodedPath = encodeURIComponent ( socketPath )
12- return `${ protocol } +unix://${ encodedPath } `
13- }
14-
15- // Unix sockets can use the unix: protocol
16- return `${ protocol } +unix://${ socketPath . replace ( / \/ / g, '%2F' ) } `
9+ // Windows named pipes need special encoding
10+ const encodedPath = process . platform === 'win32'
11+ ? encodeURIComponent ( socketPath )
12+ : socketPath . replace ( / \/ / g, '%2F' )
13+ return `${ protocol } +unix://${ encodedPath } `
1714}
1815
1916export function isSocketURL ( url : string ) : boolean {
You can’t perform that action at this time.
0 commit comments