@eleven-am/pondsocket 0.1.104 → 0.1.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nest.js +9 -9
- package/package.json +1 -1
package/nest.js
CHANGED
|
@@ -248,17 +248,12 @@ class Context {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
function manageResponse(data, response) {
|
|
251
|
-
if (response.hasResponded) {
|
|
251
|
+
if (response.hasResponded || !isNotEmpty(data)) {
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
const { event, presence, updatePresence, assigns, broadcast, accept = true } = data, rest = __rest(data, ["event", "presence", "updatePresence", "assigns", "broadcast", "accept"]);
|
|
255
|
-
if (event) {
|
|
256
|
-
|
|
257
|
-
response.send(event, rest, assigns);
|
|
258
|
-
}
|
|
259
|
-
else if (isNotEmpty(assigns)) {
|
|
260
|
-
response.accept(assigns);
|
|
261
|
-
}
|
|
255
|
+
if (event && typeof event === 'string' && isNotEmpty(rest)) {
|
|
256
|
+
response.send(event, rest, assigns);
|
|
262
257
|
}
|
|
263
258
|
if (broadcast && typeof broadcast === 'string' && isNotEmpty(rest) && 'broadcast' in response) {
|
|
264
259
|
response.broadcast(broadcast, rest);
|
|
@@ -273,7 +268,12 @@ function manageResponse(data, response) {
|
|
|
273
268
|
return;
|
|
274
269
|
}
|
|
275
270
|
if (accept) {
|
|
276
|
-
|
|
271
|
+
if (isNotEmpty(assigns)) {
|
|
272
|
+
response.accept(assigns);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
response.accept();
|
|
276
|
+
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
function manageError(error, response) {
|