partysocket
Advanced tools
Comparing version
@@ -422,3 +422,5 @@ "use strict"; | ||
try { | ||
this._ws.close(code, reason); | ||
if (this._ws.readyState === this.OPEN) { | ||
this._ws.close(code, reason); | ||
} | ||
this._handleClose(new Events.CloseEvent(code, reason, this)); | ||
@@ -530,2 +532,3 @@ } catch (error) { | ||
party, | ||
prefix, | ||
query | ||
@@ -549,3 +552,3 @@ } = partySocketOptions; | ||
)); | ||
const baseUrl = `${protocol}://${host}/${party ? `parties/${party}` : "party"}/${room}${path}`; | ||
const baseUrl = `${protocol}://${host}/${prefix || `parties/${name}/${room}`}${path}`; | ||
const makeUrl = (query2 = {}) => `${baseUrl}?${new URLSearchParams([ | ||
@@ -552,0 +555,0 @@ ...Object.entries(defaultParams), |
@@ -422,3 +422,5 @@ "use strict"; | ||
try { | ||
this._ws.close(code, reason); | ||
if (this._ws.readyState === this.OPEN) { | ||
this._ws.close(code, reason); | ||
} | ||
this._handleClose(new Events.CloseEvent(code, reason, this)); | ||
@@ -530,2 +532,3 @@ } catch (error) { | ||
party, | ||
prefix, | ||
query | ||
@@ -549,3 +552,3 @@ } = partySocketOptions; | ||
)); | ||
const baseUrl = `${protocol}://${host}/${party ? `parties/${party}` : "party"}/${room}${path}`; | ||
const baseUrl = `${protocol}://${host}/${prefix || `parties/${name}/${room}`}${path}`; | ||
const makeUrl = (query2 = {}) => `${baseUrl}?${new URLSearchParams([ | ||
@@ -552,0 +555,0 @@ ...Object.entries(defaultParams), |
@@ -496,3 +496,5 @@ "use strict"; | ||
try { | ||
this._ws.close(code, reason); | ||
if (this._ws.readyState === this.OPEN) { | ||
this._ws.close(code, reason); | ||
} | ||
this._handleClose(new Events.CloseEvent(code, reason, this)); | ||
@@ -499,0 +501,0 @@ } catch (error) { |
@@ -420,3 +420,5 @@ "use strict"; | ||
try { | ||
this._ws.close(code, reason); | ||
if (this._ws.readyState === this.OPEN) { | ||
this._ws.close(code, reason); | ||
} | ||
this._handleClose(new Events.CloseEvent(code, reason, this)); | ||
@@ -423,0 +425,0 @@ } catch (error) { |
@@ -10,2 +10,3 @@ import ReconnectingWebSocket, { Options } from './ws.js'; | ||
party?: string; | ||
prefix?: string; | ||
protocol?: "ws" | "wss"; | ||
@@ -20,2 +21,3 @@ protocols?: string[]; | ||
party?: string; | ||
prefix?: string; | ||
path?: string; | ||
@@ -22,0 +24,0 @@ protocol?: "http" | "https"; |
{ | ||
"name": "partysocket", | ||
"version": "0.0.0-3626116", | ||
"version": "0.0.0-4450548", | ||
"description": "A better WebSocket that Just Works™", | ||
@@ -5,0 +5,0 @@ "homepage": "https://docs.partykit.io/reference/partysocket-api", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
116352
0.29%3567
0.42%