partysocket
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -322,4 +322,3 @@ "use strict"; | ||
_getNextProtocols(protocolsProvider) { | ||
if (!protocolsProvider) | ||
return Promise.resolve(null); | ||
if (!protocolsProvider) return Promise.resolve(null); | ||
if (typeof protocolsProvider === "string" || Array.isArray(protocolsProvider)) { | ||
@@ -330,4 +329,3 @@ return Promise.resolve(protocolsProvider); | ||
const protocols = protocolsProvider(); | ||
if (!protocols) | ||
return Promise.resolve(null); | ||
if (!protocols) return Promise.resolve(null); | ||
if (typeof protocols === "string" || Array.isArray(protocols)) { | ||
@@ -533,2 +531,3 @@ return Promise.resolve(protocols); | ||
party, | ||
prefix, | ||
query | ||
@@ -552,3 +551,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([ | ||
@@ -555,0 +554,0 @@ ...Object.entries(defaultParams), |
@@ -322,4 +322,3 @@ "use strict"; | ||
_getNextProtocols(protocolsProvider) { | ||
if (!protocolsProvider) | ||
return Promise.resolve(null); | ||
if (!protocolsProvider) return Promise.resolve(null); | ||
if (typeof protocolsProvider === "string" || Array.isArray(protocolsProvider)) { | ||
@@ -330,4 +329,3 @@ return Promise.resolve(protocolsProvider); | ||
const protocols = protocolsProvider(); | ||
if (!protocols) | ||
return Promise.resolve(null); | ||
if (!protocols) return Promise.resolve(null); | ||
if (typeof protocols === "string" || Array.isArray(protocols)) { | ||
@@ -533,2 +531,3 @@ return Promise.resolve(protocols); | ||
party, | ||
prefix, | ||
query | ||
@@ -552,3 +551,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([ | ||
@@ -555,0 +554,0 @@ ...Object.entries(defaultParams), |
@@ -396,4 +396,3 @@ "use strict"; | ||
_getNextProtocols(protocolsProvider) { | ||
if (!protocolsProvider) | ||
return Promise.resolve(null); | ||
if (!protocolsProvider) return Promise.resolve(null); | ||
if (typeof protocolsProvider === "string" || Array.isArray(protocolsProvider)) { | ||
@@ -404,4 +403,3 @@ return Promise.resolve(protocolsProvider); | ||
const protocols = protocolsProvider(); | ||
if (!protocols) | ||
return Promise.resolve(null); | ||
if (!protocols) return Promise.resolve(null); | ||
if (typeof protocols === "string" || Array.isArray(protocols)) { | ||
@@ -408,0 +406,0 @@ return Promise.resolve(protocols); |
@@ -320,4 +320,3 @@ "use strict"; | ||
_getNextProtocols(protocolsProvider) { | ||
if (!protocolsProvider) | ||
return Promise.resolve(null); | ||
if (!protocolsProvider) return Promise.resolve(null); | ||
if (typeof protocolsProvider === "string" || Array.isArray(protocolsProvider)) { | ||
@@ -328,4 +327,3 @@ return Promise.resolve(protocolsProvider); | ||
const protocols = protocolsProvider(); | ||
if (!protocols) | ||
return Promise.resolve(null); | ||
if (!protocols) return Promise.resolve(null); | ||
if (typeof protocols === "string" || Array.isArray(protocols)) { | ||
@@ -332,0 +330,0 @@ return Promise.resolve(protocols); |
@@ -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": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A better WebSocket that Just Works™", | ||
@@ -5,0 +5,0 @@ "homepage": "https://docs.partykit.io/reference/partysocket-api", |
import { PartySocket, PartySocketOptions } from './index.js'; | ||
import { E as EventHandlerOptions } from './use-ws-YFPmbpmh.js'; | ||
export { u as useWebSocket } from './use-ws-YFPmbpmh.js'; | ||
import { E as EventHandlerOptions } from './use-ws-CnrrNZS2.js'; | ||
export { u as useWebSocket } from './use-ws-CnrrNZS2.js'; | ||
import './ws.js'; | ||
@@ -5,0 +5,0 @@ |
import './ws.js'; | ||
export { u as default } from './use-ws-YFPmbpmh.js'; | ||
export { u as default } from './use-ws-CnrrNZS2.js'; |
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
125
116218
3557