@casual-simulation/websocket 2.0.30

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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Casual Simulation, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # undom
2
+
3
+ [![NPM](https://img.shields.io/npm/v/undom.svg?style=flat)](https://www.npmjs.org/package/undom)
4
+ [![travis-ci](https://travis-ci.org/developit/undom.svg?branch=master)](https://travis-ci.org/developit/undom)
5
+
6
+ ### **Minimally viable DOM Document implementation**
7
+
8
+ > A bare-bones HTML DOM in a box. If you want the DOM but not a parser, this might be for you.
9
+ >
10
+ > `1kB`, works in Node and browsers, plugins coming soon!
11
+
12
+ [**JSFiddle Demo:**](https://jsfiddle.net/developit/4qv3v6r3/) Rendering [preact](https://github.com/developit/preact/) components into an undom Document.
13
+
14
+ [![preview](https://i.gyazo.com/7fcca9dd3e562b076293ef2cf3979d23.gif)](https://jsfiddle.net/developit/4qv3v6r3/)
15
+
16
+ ---
17
+
18
+ ## Project Goals
19
+
20
+ Undom aims to find a sweet spot between size/performance and utility. The goal is to provide the simplest possible implementation of a DOM Document, such that libraries relying on the DOM can run in places where there isn't one available.
21
+
22
+ The intent to keep things as simple as possible means undom lacks some DOM features like HTML parsing & serialization, Web Components, etc. These features can be added through additional libraries.
23
+
24
+ #### Looking to 1.0.0
25
+
26
+ As of version 1.0.0, the DOM constructors and their prototypes will be shared for all instances of a document, as is the case with [JSDOM](https://github.com/jsdom/jsdom#shared-constructors-and-prototypes). Once merged, [PR #25](https://github.com/developit/undom/pull/25) will address this by adding an `undom.env()` function, which returns a fresh document factory with a new set of constructors & prototypes.
27
+
28
+ ---
29
+
30
+ ## Installation
31
+
32
+ Via npm:
33
+
34
+ `npm install --save undom`
35
+
36
+ ---
37
+
38
+ ## Require Hook
39
+
40
+ In CommonJS environments, simply import `undom/register` to patch the global object with a singleton Document.
41
+
42
+ ```js
43
+ require('undom/register');
44
+
45
+ // now you have a DOM.
46
+ document.createElement('div');
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Usage
52
+
53
+ ```js
54
+ // import the library:
55
+ import undom from 'undom';
56
+
57
+ let document = undom();
58
+
59
+ let foo = document.createElement('foo');
60
+ foo.appendChild(document.createTextNode('Hello, World!'));
61
+ document.body.appendChild(foo);
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Recipe: Serialize to HTML
67
+
68
+ One task `undom` doesn't handle for you by default is HTML serialization. A proper implementation of this would be cumbersome to maintain and would rely heavily on getters and setters, which limits browser support. Below is a simple recipe for serializing an `undom` Element (Document, etc) to HTML.
69
+
70
+ #### Small & in ES2015:
71
+
72
+ ```js
73
+ Element.prototype.toString = function () {
74
+ return serialize(this);
75
+ };
76
+
77
+ function serialize(el) {
78
+ return el.nodeType == 3
79
+ ? enc(el.nodeValue)
80
+ : '<' +
81
+ this.nodeName.toLowerCase() +
82
+ this.attributes.map(attr).join('') +
83
+ '>' +
84
+ this.childNodes.map(serialize).join('') +
85
+ '</' +
86
+ this.nodeName.toLowerCase() +
87
+ '>';
88
+ }
89
+ let attr = (a) => ` ${a.name}="${enc(a.value)}"`;
90
+ let enc = (s) => s.replace(/[&'"<>]/g, (a) => `&#${a.codePointAt(0)};`);
91
+ ```
92
+
93
+ #### ES3 Version
94
+
95
+ This also does pretty-printing.
96
+
97
+ ```js
98
+ function serialize(el) {
99
+ if (el.nodeType === 3) return el.textContent;
100
+ var name = String(el.nodeName).toLowerCase(),
101
+ str = '<' + name,
102
+ c,
103
+ i;
104
+ for (i = 0; i < el.attributes.length; i++) {
105
+ str +=
106
+ ' ' + el.attributes[i].name + '="' + el.attributes[i].value + '"';
107
+ }
108
+ str += '>';
109
+ for (i = 0; i < el.childNodes.length; i++) {
110
+ c = serialize(el.childNodes[i]);
111
+ if (c) str += '\n\t' + c.replace(/\n/g, '\n\t');
112
+ }
113
+ return str + (c ? '\n' : '') + '</' + name + '>';
114
+ }
115
+
116
+ function enc(s) {
117
+ return s.replace(/[&'"<>]/g, function (a) {
118
+ return `&#${a};`;
119
+ });
120
+ }
121
+ ```
@@ -0,0 +1,55 @@
1
+ import { Observable, Subject } from 'rxjs';
2
+ export declare type CloseReason = CloseReasonClosed | CloseReasonOther;
3
+ export interface CloseReasonBase {
4
+ reason: string;
5
+ }
6
+ /**
7
+ * Defines an interface that indicates the web socket was closed because
8
+ * the local device decided to disconnect.
9
+ */
10
+ export interface CloseReasonClosed extends CloseReasonBase {
11
+ type: 'closed';
12
+ }
13
+ /**
14
+ * Defines an interface that indicates that the web socket was closed due to some other reason.
15
+ * For example, it is possible that the device lost connection to the server and so it was closed.
16
+ */
17
+ export interface CloseReasonOther extends CloseReasonBase {
18
+ type: 'other';
19
+ }
20
+ /**
21
+ * Defines a websocket connection that will automatically try to reconnect if the connection is lost.
22
+ */
23
+ export interface ReconnectableSocketInterface {
24
+ onOpen: Observable<void>;
25
+ onClose: Observable<CloseReason>;
26
+ onMessage: Observable<MessageEvent>;
27
+ onError: Observable<Event>;
28
+ send(data: string | ArrayBuffer | ArrayBufferView): void;
29
+ open(): void;
30
+ close(): void;
31
+ }
32
+ /**
33
+ * Defines a websocket connection that will automatically try to reconnect if the connection is lost.
34
+ */
35
+ export declare class ReconnectableSocket implements ReconnectableSocketInterface {
36
+ private _url;
37
+ private _socket;
38
+ private _closing;
39
+ private _onOpen;
40
+ private _onClose;
41
+ private _onError;
42
+ private _onMessage;
43
+ get onOpen(): Subject<void>;
44
+ get onClose(): Subject<CloseReason>;
45
+ get onError(): Subject<Event>;
46
+ get onMessage(): Subject<MessageEvent<any>>;
47
+ get socket(): WebSocket;
48
+ send(data: string | ArrayBuffer | ArrayBufferView): void;
49
+ constructor(url: string);
50
+ open(): void;
51
+ close(): void;
52
+ protected _handleMessage(event: MessageEvent): void;
53
+ private _setupSocket;
54
+ }
55
+ //# sourceMappingURL=ReconnectableSocket.d.ts.map
@@ -0,0 +1,75 @@
1
+ import { Subject } from 'rxjs';
2
+ /**
3
+ * Defines a websocket connection that will automatically try to reconnect if the connection is lost.
4
+ */
5
+ export class ReconnectableSocket {
6
+ constructor(url) {
7
+ this._onOpen = new Subject();
8
+ this._onClose = new Subject();
9
+ this._onError = new Subject();
10
+ this._onMessage = new Subject();
11
+ this._url = url;
12
+ }
13
+ get onOpen() {
14
+ return this._onOpen;
15
+ }
16
+ get onClose() {
17
+ return this._onClose;
18
+ }
19
+ get onError() {
20
+ return this._onError;
21
+ }
22
+ get onMessage() {
23
+ return this._onMessage;
24
+ }
25
+ get socket() {
26
+ return this._socket;
27
+ }
28
+ send(data) {
29
+ this._socket.send(data);
30
+ }
31
+ open() {
32
+ if (!this._socket ||
33
+ this._socket.readyState === WebSocket.CLOSED ||
34
+ this._socket.readyState === WebSocket.CLOSING) {
35
+ this._setupSocket();
36
+ }
37
+ }
38
+ close() {
39
+ if (this._socket && this._socket.readyState === WebSocket.OPEN) {
40
+ this._closing = true;
41
+ this._socket.close();
42
+ }
43
+ }
44
+ _handleMessage(event) {
45
+ this._onMessage.next(event);
46
+ }
47
+ _setupSocket() {
48
+ this._closing = false;
49
+ this._socket = new WebSocket(this._url);
50
+ this._socket.onopen = () => {
51
+ this._onOpen.next();
52
+ };
53
+ this._socket.onclose = (event) => {
54
+ if (this._closing) {
55
+ this._onClose.next({
56
+ type: 'closed',
57
+ reason: '',
58
+ });
59
+ }
60
+ else {
61
+ this._onClose.next({
62
+ type: 'other',
63
+ reason: event.reason,
64
+ });
65
+ }
66
+ };
67
+ this._socket.onerror = (event) => {
68
+ this._onError.next(event);
69
+ };
70
+ this._socket.onmessage = (event) => {
71
+ this._handleMessage(event);
72
+ };
73
+ }
74
+ }
75
+ //# sourceMappingURL=ReconnectableSocket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReconnectableSocket.js","sourceRoot":"","sources":["ReconnectableSocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAsC3C;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAkC5B,YAAY,GAAW;QA7Bf,YAAO,GAAG,IAAI,OAAO,EAAQ,CAAC;QAC9B,aAAQ,GAAG,IAAI,OAAO,EAAe,CAAC;QACtC,aAAQ,GAAG,IAAI,OAAO,EAAS,CAAC;QAChC,eAAU,GAAG,IAAI,OAAO,EAAgB,CAAC;QA2B7C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IACpB,CAAC;IA1BD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,IAA4C;QAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAMD,IAAI;QACA,IACI,CAAC,IAAI,CAAC,OAAO;YACb,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,MAAM;YAC5C,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,OAAO,EAC/C;YACE,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;IACL,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,EAAE;YAC5D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACxB;IACL,CAAC;IAES,cAAc,CAAC,KAAmB;QACxC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAEO,YAAY;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE;YACvB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;YAC7B,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,EAAE;iBACb,CAAC,CAAC;aACN;iBAAM;gBACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,KAAK,CAAC,MAAM;iBACvB,CAAC,CAAC;aACN;QACL,CAAC,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,KAAK,EAAE,EAAE;YAC/B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,37 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ReconnectableSocket } from './ReconnectableSocket';
3
+ /**
4
+ * Defines a class that is able to manage the creation and lifecycle of a WebSocket.
5
+ */
6
+ export declare class SocketManager {
7
+ private _socket;
8
+ private _forcedOffline;
9
+ private _url;
10
+ private _connectionStateChanged;
11
+ /**
12
+ * Gets an observable that resolves with the connection state of the socket.
13
+ */
14
+ get connectionStateChanged(): Observable<boolean>;
15
+ /**
16
+ * Gets whether the socket manager is forcing the user to be offline or not.
17
+ */
18
+ get forcedOffline(): boolean;
19
+ set forcedOffline(value: boolean);
20
+ /**
21
+ * Gets the WebSocket that this manager has constructed.
22
+ */
23
+ get socket(): ReconnectableSocket;
24
+ /**
25
+ * Creates a new SocketManager.
26
+ * @param user The user account to use for connecting.
27
+ * @param url The URL to connect to.
28
+ */
29
+ constructor(url?: string);
30
+ init(): void;
31
+ /**
32
+ * Toggles whether the socket manager should be forcing the user's
33
+ * connection to the server to be offline.
34
+ */
35
+ toggleForceOffline(): void;
36
+ }
37
+ //# sourceMappingURL=WebSocketManager.d.ts.map
@@ -0,0 +1,76 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ import { debounceTime, filter, tap } from 'rxjs/operators';
3
+ import { ReconnectableSocket } from './ReconnectableSocket';
4
+ const RECONNECT_TIME = 5000;
5
+ /**
6
+ * Defines a class that is able to manage the creation and lifecycle of a WebSocket.
7
+ */
8
+ export class SocketManager {
9
+ /**
10
+ * Creates a new SocketManager.
11
+ * @param user The user account to use for connecting.
12
+ * @param url The URL to connect to.
13
+ */
14
+ constructor(url) {
15
+ // Whether this manager has forced the user to be offline or not.
16
+ this._forcedOffline = false;
17
+ this._connectionStateChanged = new BehaviorSubject(false);
18
+ this._url = url;
19
+ }
20
+ /**
21
+ * Gets an observable that resolves with the connection state of the socket.
22
+ */
23
+ get connectionStateChanged() {
24
+ return this._connectionStateChanged;
25
+ }
26
+ /**
27
+ * Gets whether the socket manager is forcing the user to be offline or not.
28
+ */
29
+ get forcedOffline() {
30
+ return this._forcedOffline;
31
+ }
32
+ set forcedOffline(value) {
33
+ this._forcedOffline = !this._forcedOffline;
34
+ if (this._forcedOffline) {
35
+ this._socket.close();
36
+ }
37
+ else {
38
+ this._socket.open();
39
+ }
40
+ }
41
+ /**
42
+ * Gets the WebSocket that this manager has constructed.
43
+ */
44
+ get socket() {
45
+ return this._socket;
46
+ }
47
+ init() {
48
+ console.log('[WebSocketManager] Starting...');
49
+ this._socket = new ReconnectableSocket(this._url);
50
+ this._socket.onClose
51
+ .pipe(filter((e) => e.type === 'other'), debounceTime(RECONNECT_TIME), tap(() => {
52
+ console.log('[WebSocketManager] Reconnecting...');
53
+ this._socket.open();
54
+ }))
55
+ .subscribe();
56
+ this._socket.onError.subscribe((event) => {
57
+ console.log('[WebSocketManager] Error:', event);
58
+ });
59
+ this._socket.onOpen.subscribe(() => {
60
+ console.log('[WebSocketManager] Connected.');
61
+ this._connectionStateChanged.next(true);
62
+ });
63
+ this._socket.onClose.subscribe(() => {
64
+ console.log('[WebSocketManager] Closed.');
65
+ this._connectionStateChanged.next(false);
66
+ });
67
+ }
68
+ /**
69
+ * Toggles whether the socket manager should be forcing the user's
70
+ * connection to the server to be offline.
71
+ */
72
+ toggleForceOffline() {
73
+ this.forcedOffline = !this.forcedOffline;
74
+ }
75
+ }
76
+ //# sourceMappingURL=WebSocketManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebSocketManager.js","sourceRoot":"","sources":["WebSocketManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAiB,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B;;GAEG;AACH,MAAM,OAAO,aAAa;IAuCtB;;;;OAIG;IACH,YAAY,GAAY;QAzCxB,iEAAiE;QACzD,mBAAc,GAAY,KAAK,CAAC;QAyCpC,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IACpB,CAAC;IAtCD;;OAEG;IACH,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,aAAa,CAAC,KAAc;QACnC,IAAI,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC;QAC3C,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACxB;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;SACvB;IACL,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAYD,IAAI;QACA,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,OAAO;aACf,IAAI,CACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EACjC,YAAY,CAAC,cAAc,CAAC,EAC5B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;YAClD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC,CACL;aACA,SAAS,EAAE,CAAC;QAEjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE;YAC/B,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC7C,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;YAC1C,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,kBAAkB;QACd,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,CAAC;CACJ"}
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './WebSocketManager';
2
+ export * from './ReconnectableSocket';
3
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './WebSocketManager';
2
+ export * from './ReconnectableSocket';
3
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@casual-simulation/websocket",
3
+ "version": "2.0.30",
4
+ "description": "Minimal WebSocket implementation",
5
+ "keywords": [],
6
+ "author": "Casual Simulation, Inc.",
7
+ "homepage": "https://github.com/casual-simulation/casualos",
8
+ "license": "MIT",
9
+ "main": "index.js",
10
+ "types": "index.d.ts",
11
+ "module": "index",
12
+ "directories": {
13
+ "lib": "."
14
+ },
15
+ "files": [
16
+ "/README.md",
17
+ "/LICENSE.txt",
18
+ "**/*.js",
19
+ "**/*.js.map",
20
+ "**/*.d.ts"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/casual-simulation/casualos.git"
25
+ },
26
+ "scripts": {
27
+ "watch": "tsc --watch",
28
+ "watch:player": "npm run watch",
29
+ "build": "echo \"Nothing to do.\"",
30
+ "build:docs": "typedoc --mode file --excludeNotExported --out ../../api-docs/crypto .",
31
+ "test": "jest",
32
+ "test:watch": "jest --watchAll"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/casual-simulation/casualos/issues"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "gitHead": "02da28eafc22129f482dc302859ce036a6ae7578"
41
+ }