topsyde-utils 1.0.167 → 1.0.168
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.
@@ -1,3 +1,3 @@
|
|
1
1
|
import { I_WebsocketEntity, WebsocketStructuredMessage } from "./websocket.types";
|
2
2
|
export declare function IsWebsocketStructuredMessage(message: any): message is WebsocketStructuredMessage;
|
3
|
-
export declare function
|
3
|
+
export declare function IsWebsocketEntity(entity: any): entity is I_WebsocketEntity;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export function IsWebsocketStructuredMessage(message) {
|
2
2
|
return typeof message === "object" && message !== null && "type" in message && "content" in message;
|
3
3
|
}
|
4
|
-
export function
|
4
|
+
export function IsWebsocketEntity(entity) {
|
5
5
|
return (typeof entity === "object" &&
|
6
6
|
entity !== null &&
|
7
7
|
"id" in entity &&
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"websocket.guards.js","sourceRoot":"","sources":["../../../../src/server/bun/websocket/websocket.guards.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,4BAA4B,CAAC,OAAY;IACxD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,MAAM,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAW;IAC5C,OAAO,CACN,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,IAAI,IAAI,MAAM;QACd,MAAM,IAAI,MAAM;QAChB,IAAI,IAAI,MAAM;QACd,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ;QAC7B,MAAM,CAAC,EAAE,KAAK,IAAI;QAClB,MAAM,IAAI,MAAM,CAAC,EAAE;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,IAAI,MAAM,CAAC,EAAE;QACpB,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,KAAK,UAAU,CACrC,CAAC;AACH,CAAC","sourcesContent":["import { I_WebsocketClient, I_WebsocketEntity, WebsocketStructuredMessage } from \"./websocket.types\";\nimport { type ServerWebSocket } from \"bun\";\n\nexport function IsWebsocketStructuredMessage(message: any): message is WebsocketStructuredMessage {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message;\n}\n\nexport function
|
1
|
+
{"version":3,"file":"websocket.guards.js","sourceRoot":"","sources":["../../../../src/server/bun/websocket/websocket.guards.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,4BAA4B,CAAC,OAAY;IACxD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,MAAM,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAW;IAC5C,OAAO,CACN,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,IAAI,IAAI,MAAM;QACd,MAAM,IAAI,MAAM;QAChB,IAAI,IAAI,MAAM;QACd,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ;QAC7B,MAAM,CAAC,EAAE,KAAK,IAAI;QAClB,MAAM,IAAI,MAAM,CAAC,EAAE;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,IAAI,MAAM,CAAC,EAAE;QACpB,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,KAAK,UAAU,CACrC,CAAC;AACH,CAAC","sourcesContent":["import { I_WebsocketClient, I_WebsocketEntity, WebsocketStructuredMessage } from \"./websocket.types\";\nimport { type ServerWebSocket } from \"bun\";\n\nexport function IsWebsocketStructuredMessage(message: any): message is WebsocketStructuredMessage {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message;\n}\n\nexport function IsWebsocketEntity(entity: any): entity is I_WebsocketEntity {\n\treturn (\n\t\ttypeof entity === \"object\" &&\n\t\tentity !== null &&\n\t\t\"id\" in entity &&\n\t\t\"name\" in entity &&\n\t\t\"ws\" in entity &&\n\t\ttypeof entity.ws === \"object\" &&\n\t\tentity.ws !== null &&\n\t\t\"send\" in entity.ws &&\n\t\ttypeof entity.ws.send === \"function\" &&\n\t\t\"close\" in entity.ws &&\n\t\ttypeof entity.ws.close === \"function\"\n\t);\n}\n"]}
|
package/package.json
CHANGED
@@ -5,7 +5,7 @@ export function IsWebsocketStructuredMessage(message: any): message is Websocket
|
|
5
5
|
return typeof message === "object" && message !== null && "type" in message && "content" in message;
|
6
6
|
}
|
7
7
|
|
8
|
-
export function
|
8
|
+
export function IsWebsocketEntity(entity: any): entity is I_WebsocketEntity {
|
9
9
|
return (
|
10
10
|
typeof entity === "object" &&
|
11
11
|
entity !== null &&
|