partysocket
Advanced tools
Comparing version 0.0.0-4c4d80b to 0.0.0-4c5a737
@@ -23,2 +23,3 @@ "use strict"; | ||
__export(src_exports, { | ||
PartySocket: () => PartySocket, | ||
WebSocket: () => ReconnectingWebSocket, | ||
@@ -322,4 +323,3 @@ default: () => PartySocket | ||
_getNextProtocols(protocolsProvider) { | ||
if (!protocolsProvider) | ||
return Promise.resolve(null); | ||
if (!protocolsProvider) return Promise.resolve(null); | ||
if (typeof protocolsProvider === "string" || Array.isArray(protocolsProvider)) { | ||
@@ -330,4 +330,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 +532,3 @@ return Promise.resolve(protocols); | ||
party, | ||
prefix, | ||
query | ||
@@ -552,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([ | ||
@@ -658,2 +658,3 @@ ...Object.entries(defaultParams), | ||
0 && (module.exports = { | ||
PartySocket, | ||
WebSocket | ||
@@ -660,0 +661,0 @@ }); |
@@ -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; | ||
@@ -47,2 +49,2 @@ protocol?: "http" | "https"; | ||
export { type PartyFetchOptions, type PartySocketOptions, ReconnectingWebSocket as WebSocket, PartySocket as default }; | ||
export { type PartyFetchOptions, PartySocket, type PartySocketOptions, ReconnectingWebSocket as WebSocket, PartySocket as default }; |
{ | ||
"name": "partysocket", | ||
"version": "0.0.0-4c4d80b", | ||
"version": "0.0.0-4c5a737", | ||
"description": "A better WebSocket that Just Works™", | ||
@@ -5,0 +5,0 @@ "homepage": "https://docs.partykit.io/reference/partysocket-api", |
@@ -1,4 +0,4 @@ | ||
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 { PartySocket, PartySocketOptions } from './index.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116067
3557