+
+
+
+
+
+
\ No newline at end of file
diff --git "a/system/websocket_test/em-ws-web\050intro\051/client/websocket.js" "b/system/websocket_test/em-ws-web\050intro\051/client/websocket.js"
new file mode 100755
index 0000000..1fff9f2
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/client/websocket.js"
@@ -0,0 +1,115 @@
+// Node.js file
+function init() {
+ let connectionButton = document.getElementById("connection"),
+ disconnectionButton = document.getElementById("disconnection"),
+ websocketStateButton = document.getElementById("websocketState"),
+ button = document.getElementById("send"),
+ connectState = document.getElementById("connectState"),
+ speedButton = document.getElementById("speedButton"),
+ answerColumn = document.getElementById("answerColumn"),
+ socket,
+ button_clicker = [];
+
+ button.addEventListener("click", decideNameAndTeam, false);
+ let clientInfo = {
+ // id: null,
+ name: null,
+ team: null
+ }
+
+ function decideNameAndTeam() {
+ let name = document.getElementById("name").value;
+ clientInfo.name = name;
+ let team = document.getElementById("team").value;
+ clientInfo.team = team;
+ // button.disabled = true;
+ // teamとnameを変えたいときは,socket.send(clientInfo)で送る、Ruby側で、if idがあれば、名前とチームを変える処理をする
+ }
+
+ function websocket() {
+ console.log(clientInfo);
+ console.log(JSON.stringify(clientInfo));
+
+ try {
+ if (!socket || socket.readyState !== 1) { //!socketは最初の接続のときに真になる、socket.readyStateは接続後に真になる
+
+ socket = new WebSocket('wss://www.koeki-prj.org/quiz2024');
+ // socket = new WebSocket('ws://localhost:8293');
+ socket.onopen = function (event) {
+ console.log("JS:接続されました!");
+ socket.send(`JS: ${clientInfo["team"]} の ${clientInfo["name"]} です!`)
+ };
+
+ socket.onmessage = function (event) {
+ let receivedMsg = event.data;
+ try {
+ button_clicker = JSON.parse(receivedMsg);
+ // console.log(button_clicker);
+ answerColumn.innerHTML = "" //表示場所のリセット
+ for (let i = 0; i < button_clicker.length; i++) {
+ // console.log(button_clicker[i][1]);
+ answerColumn.innerHTML += `${i + 1}: ${button_clicker[i][0]} の ${button_clicker[i][1]} です! `
+ }
+ } catch (error) {
+ console.log(receivedMsg);
+ if (receivedMsg == "reset") {
+ answerColumn.innerHTML = "";
+ }
+ }
+ }
+
+ socket.onclose = function (event) {
+ if (event.wasClean) {
+ console.log("JS:切断しました!")
+ } else {
+ console.error("JS:切断エラーが起きました!");
+ }
+ }
+
+ socket.onerror = function (error) {
+ console.error("JS:WebSocket Error" + error)
+ }
+ }
+ } catch (error) {
+ console.error("エラーが発生しました!" + error);
+ }
+ }
+
+ function socketClose() {
+ if (socket.readyState == 1) {
+ console.log(socket); //このときsocket.readyStateが1になっている
+ socket.close();
+ console.log(socket); //このときsocket.readyStateが2になる
+ }
+ }
+
+ function socketState() {
+ // console.log(socket.readyState); //websocket切断後にこの関数を実行するとsocket.readyStateが3になる
+ switch (socket.readyState) {
+ case 0:
+ connectState.innerHTML = "CONNECTING";
+ break;
+ case 1:
+ connectState.innerHTML = "OPEN";
+ break;
+ case 2:
+ connectState.innerHTML = "CLOSING";
+ break;
+ case 3:
+ connectState.innerHTML = "CLOSED";
+ break;
+ }
+ }
+
+ function sendAnswer() {
+ socket.send(`JS: ${clientInfo["team"]} の ${clientInfo["name"]} がボタンを押しました!`)
+ socket.send(JSON.stringify(clientInfo))
+ }
+
+ connectionButton.addEventListener("click", websocket, false);
+ disconnectionButton.addEventListener("click", socketClose, false);
+ websocketStateButton.addEventListener("click", socketState, false);
+ speedButton.addEventListener("click", sendAnswer, false);
+}
+
+init()
diff --git "a/system/websocket_test/em-ws-web\050intro\051/mp3/mp3_path.csv" "b/system/websocket_test/em-ws-web\050intro\051/mp3/mp3_path.csv"
new file mode 100644
index 0000000..6681586
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/mp3/mp3_path.csv"
@@ -0,0 +1,4 @@
+song,path
+test1,../mp3/test1.mp3
+test2,../mp3/test2.mp3
+test3,../mp3/test3.mp3
\ No newline at end of file
diff --git "a/system/websocket_test/em-ws-web\050intro\051/mp3/test1.mp3" "b/system/websocket_test/em-ws-web\050intro\051/mp3/test1.mp3"
new file mode 100644
index 0000000..f44d693
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/mp3/test1.mp3"
Binary files differ
diff --git "a/system/websocket_test/em-ws-web\050intro\051/mp3/test2.mp3" "b/system/websocket_test/em-ws-web\050intro\051/mp3/test2.mp3"
new file mode 100644
index 0000000..2389db7
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/mp3/test2.mp3"
Binary files differ
diff --git "a/system/websocket_test/em-ws-web\050intro\051/mp3/test3.mp3" "b/system/websocket_test/em-ws-web\050intro\051/mp3/test3.mp3"
new file mode 100644
index 0000000..ab10fde
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/mp3/test3.mp3"
Binary files differ
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/.package-lock.json" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/.package-lock.json"
new file mode 100644
index 0000000..9a76020
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/.package-lock.json"
@@ -0,0 +1,28 @@
+{
+ "name": "em-ws-web",
+ "version": "1.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "node_modules/ws": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/LICENSE" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/LICENSE"
new file mode 100644
index 0000000..1da5b96
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/LICENSE"
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Einar Otto Stangvik
+Copyright (c) 2013 Arnout Kazemier and contributors
+Copyright (c) 2016 Luigi Pinca and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/README.md" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/README.md"
new file mode 100644
index 0000000..21f10df
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/README.md"
@@ -0,0 +1,548 @@
+# ws: a Node.js WebSocket library
+
+[](https://www.npmjs.com/package/ws)
+[](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster)
+[](https://coveralls.io/github/websockets/ws)
+
+ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and
+server implementation.
+
+Passes the quite extensive Autobahn test suite: [server][server-report],
+[client][client-report].
+
+**Note**: This module does not work in the browser. The client in the docs is a
+reference to a backend with the role of a client in the WebSocket communication.
+Browser clients must use the native
+[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
+object. To make the same code work seamlessly on Node.js and the browser, you
+can use one of the many wrappers available on npm, like
+[isomorphic-ws](https://github.com/heineiuo/isomorphic-ws).
+
+## Table of Contents
+
+- [Protocol support](#protocol-support)
+- [Installing](#installing)
+ - [Opt-in for performance](#opt-in-for-performance)
+ - [Legacy opt-in for performance](#legacy-opt-in-for-performance)
+- [API docs](#api-docs)
+- [WebSocket compression](#websocket-compression)
+- [Usage examples](#usage-examples)
+ - [Sending and receiving text data](#sending-and-receiving-text-data)
+ - [Sending binary data](#sending-binary-data)
+ - [Simple server](#simple-server)
+ - [External HTTP/S server](#external-https-server)
+ - [Multiple servers sharing a single HTTP/S server](#multiple-servers-sharing-a-single-https-server)
+ - [Client authentication](#client-authentication)
+ - [Server broadcast](#server-broadcast)
+ - [Round-trip time](#round-trip-time)
+ - [Use the Node.js streams API](#use-the-nodejs-streams-api)
+ - [Other examples](#other-examples)
+- [FAQ](#faq)
+ - [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client)
+ - [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections)
+ - [How to connect via a proxy?](#how-to-connect-via-a-proxy)
+- [Changelog](#changelog)
+- [License](#license)
+
+## Protocol support
+
+- **HyBi drafts 07-12** (Use the option `protocolVersion: 8`)
+- **HyBi drafts 13-17** (Current default, alternatively option
+ `protocolVersion: 13`)
+
+## Installing
+
+```
+npm install ws
+```
+
+### Opt-in for performance
+
+[bufferutil][] is an optional module that can be installed alongside the ws
+module:
+
+```
+npm install --save-optional bufferutil
+```
+
+This is a binary addon that improves the performance of certain operations such
+as masking and unmasking the data payload of the WebSocket frames. Prebuilt
+binaries are available for the most popular platforms, so you don't necessarily
+need to have a C++ compiler installed on your machine.
+
+To force ws to not use bufferutil, use the
+[`WS_NO_BUFFER_UTIL`](./doc/ws.md#ws_no_buffer_util) environment variable. This
+can be useful to enhance security in systems where a user can put a package in
+the package search path of an application of another user, due to how the
+Node.js resolver algorithm works.
+
+#### Legacy opt-in for performance
+
+If you are running on an old version of Node.js (prior to v18.14.0), ws also
+supports the [utf-8-validate][] module:
+
+```
+npm install --save-optional utf-8-validate
+```
+
+This contains a binary polyfill for [`buffer.isUtf8()`][].
+
+To force ws not to use utf-8-validate, use the
+[`WS_NO_UTF_8_VALIDATE`](./doc/ws.md#ws_no_utf_8_validate) environment variable.
+
+## API docs
+
+See [`/doc/ws.md`](./doc/ws.md) for Node.js-like documentation of ws classes and
+utility functions.
+
+## WebSocket compression
+
+ws supports the [permessage-deflate extension][permessage-deflate] which enables
+the client and server to negotiate a compression algorithm and its parameters,
+and then selectively apply it to the data payloads of each WebSocket message.
+
+The extension is disabled by default on the server and enabled by default on the
+client. It adds a significant overhead in terms of performance and memory
+consumption so we suggest to enable it only if it is really needed.
+
+Note that Node.js has a variety of issues with high-performance compression,
+where increased concurrency, especially on Linux, can lead to [catastrophic
+memory fragmentation][node-zlib-bug] and slow performance. If you intend to use
+permessage-deflate in production, it is worthwhile to set up a test
+representative of your workload and ensure Node.js/zlib will handle it with
+acceptable performance and memory usage.
+
+Tuning of permessage-deflate can be done via the options defined below. You can
+also use `zlibDeflateOptions` and `zlibInflateOptions`, which is passed directly
+into the creation of [raw deflate/inflate streams][node-zlib-deflaterawdocs].
+
+See [the docs][ws-server-options] for more options.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({
+ port: 8080,
+ perMessageDeflate: {
+ zlibDeflateOptions: {
+ // See zlib defaults.
+ chunkSize: 1024,
+ memLevel: 7,
+ level: 3
+ },
+ zlibInflateOptions: {
+ chunkSize: 10 * 1024
+ },
+ // Other options settable:
+ clientNoContextTakeover: true, // Defaults to negotiated value.
+ serverNoContextTakeover: true, // Defaults to negotiated value.
+ serverMaxWindowBits: 10, // Defaults to negotiated value.
+ // Below options specified as default values.
+ concurrencyLimit: 10, // Limits zlib concurrency for perf.
+ threshold: 1024 // Size (in bytes) below which messages
+ // should not be compressed if context takeover is disabled.
+ }
+});
+```
+
+The client will only use the extension if it is supported and enabled on the
+server. To always disable the extension on the client, set the
+`perMessageDeflate` option to `false`.
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path', {
+ perMessageDeflate: false
+});
+```
+
+## Usage examples
+
+### Sending and receiving text data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ ws.send('something');
+});
+
+ws.on('message', function message(data) {
+ console.log('received: %s', data);
+});
+```
+
+### Sending binary data
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ const array = new Float32Array(5);
+
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = i / 2;
+ }
+
+ ws.send(array);
+});
+```
+
+### Simple server
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+```
+
+### External HTTP/S server
+
+```js
+import { createServer } from 'https';
+import { readFileSync } from 'fs';
+import { WebSocketServer } from 'ws';
+
+const server = createServer({
+ cert: readFileSync('/path/to/cert.pem'),
+ key: readFileSync('/path/to/key.pem')
+});
+const wss = new WebSocketServer({ server });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log('received: %s', data);
+ });
+
+ ws.send('something');
+});
+
+server.listen(8080);
+```
+
+### Multiple servers sharing a single HTTP/S server
+
+```js
+import { createServer } from 'http';
+import { WebSocketServer } from 'ws';
+
+const server = createServer();
+const wss1 = new WebSocketServer({ noServer: true });
+const wss2 = new WebSocketServer({ noServer: true });
+
+wss1.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+wss2.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ // ...
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ const { pathname } = new URL(request.url, 'wss://base.url');
+
+ if (pathname === '/foo') {
+ wss1.handleUpgrade(request, socket, head, function done(ws) {
+ wss1.emit('connection', ws, request);
+ });
+ } else if (pathname === '/bar') {
+ wss2.handleUpgrade(request, socket, head, function done(ws) {
+ wss2.emit('connection', ws, request);
+ });
+ } else {
+ socket.destroy();
+ }
+});
+
+server.listen(8080);
+```
+
+### Client authentication
+
+```js
+import { createServer } from 'http';
+import { WebSocketServer } from 'ws';
+
+function onSocketError(err) {
+ console.error(err);
+}
+
+const server = createServer();
+const wss = new WebSocketServer({ noServer: true });
+
+wss.on('connection', function connection(ws, request, client) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data) {
+ console.log(`Received message ${data} from user ${client}`);
+ });
+});
+
+server.on('upgrade', function upgrade(request, socket, head) {
+ socket.on('error', onSocketError);
+
+ // This function is not defined on purpose. Implement it with your own logic.
+ authenticate(request, function next(err, client) {
+ if (err || !client) {
+ socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
+ socket.destroy();
+ return;
+ }
+
+ socket.removeListener('error', onSocketError);
+
+ wss.handleUpgrade(request, socket, head, function done(ws) {
+ wss.emit('connection', ws, request, client);
+ });
+ });
+});
+
+server.listen(8080);
+```
+
+Also see the provided [example][session-parse-example] using `express-session`.
+
+### Server broadcast
+
+A client WebSocket broadcasting to all connected WebSocket clients, including
+itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+A client WebSocket broadcasting to every other connected WebSocket clients,
+excluding itself.
+
+```js
+import WebSocket, { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.on('error', console.error);
+
+ ws.on('message', function message(data, isBinary) {
+ wss.clients.forEach(function each(client) {
+ if (client !== ws && client.readyState === WebSocket.OPEN) {
+ client.send(data, { binary: isBinary });
+ }
+ });
+ });
+});
+```
+
+### Round-trip time
+
+```js
+import WebSocket from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+ws.on('error', console.error);
+
+ws.on('open', function open() {
+ console.log('connected');
+ ws.send(Date.now());
+});
+
+ws.on('close', function close() {
+ console.log('disconnected');
+});
+
+ws.on('message', function message(data) {
+ console.log(`Round-trip time: ${Date.now() - data} ms`);
+
+ setTimeout(function timeout() {
+ ws.send(Date.now());
+ }, 500);
+});
+```
+
+### Use the Node.js streams API
+
+```js
+import WebSocket, { createWebSocketStream } from 'ws';
+
+const ws = new WebSocket('wss://websocket-echo.com/');
+
+const duplex = createWebSocketStream(ws, { encoding: 'utf8' });
+
+duplex.on('error', console.error);
+
+duplex.pipe(process.stdout);
+process.stdin.pipe(duplex);
+```
+
+### Other examples
+
+For a full example with a browser client communicating with a ws server, see the
+examples folder.
+
+Otherwise, see the test cases.
+
+## FAQ
+
+### How to get the IP address of the client?
+
+The remote IP address can be obtained from the raw socket.
+
+```js
+import { WebSocketServer } from 'ws';
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws, req) {
+ const ip = req.socket.remoteAddress;
+
+ ws.on('error', console.error);
+});
+```
+
+When the server runs behind a proxy like NGINX, the de-facto standard is to use
+the `X-Forwarded-For` header.
+
+```js
+wss.on('connection', function connection(ws, req) {
+ const ip = req.headers['x-forwarded-for'].split(',')[0].trim();
+
+ ws.on('error', console.error);
+});
+```
+
+### How to detect and close broken connections?
+
+Sometimes, the link between the server and the client can be interrupted in a
+way that keeps both the server and the client unaware of the broken state of the
+connection (e.g. when pulling the cord).
+
+In these cases, ping messages can be used as a means to verify that the remote
+endpoint is still responsive.
+
+```js
+import { WebSocketServer } from 'ws';
+
+function heartbeat() {
+ this.isAlive = true;
+}
+
+const wss = new WebSocketServer({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+ ws.isAlive = true;
+ ws.on('error', console.error);
+ ws.on('pong', heartbeat);
+});
+
+const interval = setInterval(function ping() {
+ wss.clients.forEach(function each(ws) {
+ if (ws.isAlive === false) return ws.terminate();
+
+ ws.isAlive = false;
+ ws.ping();
+ });
+}, 30000);
+
+wss.on('close', function close() {
+ clearInterval(interval);
+});
+```
+
+Pong messages are automatically sent in response to ping messages as required by
+the spec.
+
+Just like the server example above, your clients might as well lose connection
+without knowing it. You might want to add a ping listener on your clients to
+prevent that. A simple implementation would be:
+
+```js
+import WebSocket from 'ws';
+
+function heartbeat() {
+ clearTimeout(this.pingTimeout);
+
+ // Use `WebSocket#terminate()`, which immediately destroys the connection,
+ // instead of `WebSocket#close()`, which waits for the close timer.
+ // Delay should be equal to the interval at which your server
+ // sends out pings plus a conservative assumption of the latency.
+ this.pingTimeout = setTimeout(() => {
+ this.terminate();
+ }, 30000 + 1000);
+}
+
+const client = new WebSocket('wss://websocket-echo.com/');
+
+client.on('error', console.error);
+client.on('open', heartbeat);
+client.on('ping', heartbeat);
+client.on('close', function clear() {
+ clearTimeout(this.pingTimeout);
+});
+```
+
+### How to connect via a proxy?
+
+Use a custom `http.Agent` implementation like [https-proxy-agent][] or
+[socks-proxy-agent][].
+
+## Changelog
+
+We're using the GitHub [releases][changelog] for changelog entries.
+
+## License
+
+[MIT](LICENSE)
+
+[`buffer.isutf8()`]: https://nodejs.org/api/buffer.html#bufferisutf8input
+[bufferutil]: https://github.com/websockets/bufferutil
+[changelog]: https://github.com/websockets/ws/releases
+[client-report]: http://websockets.github.io/ws/autobahn/clients/
+[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
+[node-zlib-bug]: https://github.com/nodejs/node/issues/8871
+[node-zlib-deflaterawdocs]:
+ https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options
+[permessage-deflate]: https://tools.ietf.org/html/rfc7692
+[server-report]: http://websockets.github.io/ws/autobahn/servers/
+[session-parse-example]: ./examples/express-session-parse
+[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
+[utf-8-validate]: https://github.com/websockets/utf-8-validate
+[ws-server-options]: ./doc/ws.md#new-websocketserveroptions-callback
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/browser.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/browser.js"
new file mode 100644
index 0000000..ca4f628
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/browser.js"
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = function () {
+ throw new Error(
+ 'ws does not work in the browser. Browser clients must use the native ' +
+ 'WebSocket object'
+ );
+};
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/index.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/index.js"
new file mode 100644
index 0000000..41edb3b
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/index.js"
@@ -0,0 +1,13 @@
+'use strict';
+
+const WebSocket = require('./lib/websocket');
+
+WebSocket.createWebSocketStream = require('./lib/stream');
+WebSocket.Server = require('./lib/websocket-server');
+WebSocket.Receiver = require('./lib/receiver');
+WebSocket.Sender = require('./lib/sender');
+
+WebSocket.WebSocket = WebSocket;
+WebSocket.WebSocketServer = WebSocket.Server;
+
+module.exports = WebSocket;
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/buffer-util.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/buffer-util.js"
new file mode 100644
index 0000000..f7536e2
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/buffer-util.js"
@@ -0,0 +1,131 @@
+'use strict';
+
+const { EMPTY_BUFFER } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+
+/**
+ * Merges an array of buffers into a new buffer.
+ *
+ * @param {Buffer[]} list The array of buffers to concat
+ * @param {Number} totalLength The total length of buffers in the list
+ * @return {Buffer} The resulting buffer
+ * @public
+ */
+function concat(list, totalLength) {
+ if (list.length === 0) return EMPTY_BUFFER;
+ if (list.length === 1) return list[0];
+
+ const target = Buffer.allocUnsafe(totalLength);
+ let offset = 0;
+
+ for (let i = 0; i < list.length; i++) {
+ const buf = list[i];
+ target.set(buf, offset);
+ offset += buf.length;
+ }
+
+ if (offset < totalLength) {
+ return new FastBuffer(target.buffer, target.byteOffset, offset);
+ }
+
+ return target;
+}
+
+/**
+ * Masks a buffer using the given mask.
+ *
+ * @param {Buffer} source The buffer to mask
+ * @param {Buffer} mask The mask to use
+ * @param {Buffer} output The buffer where to store the result
+ * @param {Number} offset The offset at which to start writing
+ * @param {Number} length The number of bytes to mask.
+ * @public
+ */
+function _mask(source, mask, output, offset, length) {
+ for (let i = 0; i < length; i++) {
+ output[offset + i] = source[i] ^ mask[i & 3];
+ }
+}
+
+/**
+ * Unmasks a buffer using the given mask.
+ *
+ * @param {Buffer} buffer The buffer to unmask
+ * @param {Buffer} mask The mask to use
+ * @public
+ */
+function _unmask(buffer, mask) {
+ for (let i = 0; i < buffer.length; i++) {
+ buffer[i] ^= mask[i & 3];
+ }
+}
+
+/**
+ * Converts a buffer to an `ArrayBuffer`.
+ *
+ * @param {Buffer} buf The buffer to convert
+ * @return {ArrayBuffer} Converted buffer
+ * @public
+ */
+function toArrayBuffer(buf) {
+ if (buf.length === buf.buffer.byteLength) {
+ return buf.buffer;
+ }
+
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
+}
+
+/**
+ * Converts `data` to a `Buffer`.
+ *
+ * @param {*} data The data to convert
+ * @return {Buffer} The buffer
+ * @throws {TypeError}
+ * @public
+ */
+function toBuffer(data) {
+ toBuffer.readOnly = true;
+
+ if (Buffer.isBuffer(data)) return data;
+
+ let buf;
+
+ if (data instanceof ArrayBuffer) {
+ buf = new FastBuffer(data);
+ } else if (ArrayBuffer.isView(data)) {
+ buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);
+ } else {
+ buf = Buffer.from(data);
+ toBuffer.readOnly = false;
+ }
+
+ return buf;
+}
+
+module.exports = {
+ concat,
+ mask: _mask,
+ toArrayBuffer,
+ toBuffer,
+ unmask: _unmask
+};
+
+/* istanbul ignore else */
+if (!process.env.WS_NO_BUFFER_UTIL) {
+ try {
+ const bufferUtil = require('bufferutil');
+
+ module.exports.mask = function (source, mask, output, offset, length) {
+ if (length < 48) _mask(source, mask, output, offset, length);
+ else bufferUtil.mask(source, mask, output, offset, length);
+ };
+
+ module.exports.unmask = function (buffer, mask) {
+ if (buffer.length < 32) _unmask(buffer, mask);
+ else bufferUtil.unmask(buffer, mask);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/constants.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/constants.js"
new file mode 100644
index 0000000..74214d4
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/constants.js"
@@ -0,0 +1,18 @@
+'use strict';
+
+const BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments'];
+const hasBlob = typeof Blob !== 'undefined';
+
+if (hasBlob) BINARY_TYPES.push('blob');
+
+module.exports = {
+ BINARY_TYPES,
+ EMPTY_BUFFER: Buffer.alloc(0),
+ GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
+ hasBlob,
+ kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),
+ kListener: Symbol('kListener'),
+ kStatusCode: Symbol('status-code'),
+ kWebSocket: Symbol('websocket'),
+ NOOP: () => {}
+};
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/event-target.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/event-target.js"
new file mode 100644
index 0000000..fea4cbc
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/event-target.js"
@@ -0,0 +1,292 @@
+'use strict';
+
+const { kForOnEventAttribute, kListener } = require('./constants');
+
+const kCode = Symbol('kCode');
+const kData = Symbol('kData');
+const kError = Symbol('kError');
+const kMessage = Symbol('kMessage');
+const kReason = Symbol('kReason');
+const kTarget = Symbol('kTarget');
+const kType = Symbol('kType');
+const kWasClean = Symbol('kWasClean');
+
+/**
+ * Class representing an event.
+ */
+class Event {
+ /**
+ * Create a new `Event`.
+ *
+ * @param {String} type The name of the event
+ * @throws {TypeError} If the `type` argument is not specified
+ */
+ constructor(type) {
+ this[kTarget] = null;
+ this[kType] = type;
+ }
+
+ /**
+ * @type {*}
+ */
+ get target() {
+ return this[kTarget];
+ }
+
+ /**
+ * @type {String}
+ */
+ get type() {
+ return this[kType];
+ }
+}
+
+Object.defineProperty(Event.prototype, 'target', { enumerable: true });
+Object.defineProperty(Event.prototype, 'type', { enumerable: true });
+
+/**
+ * Class representing a close event.
+ *
+ * @extends Event
+ */
+class CloseEvent extends Event {
+ /**
+ * Create a new `CloseEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {Number} [options.code=0] The status code explaining why the
+ * connection was closed
+ * @param {String} [options.reason=''] A human-readable string explaining why
+ * the connection was closed
+ * @param {Boolean} [options.wasClean=false] Indicates whether or not the
+ * connection was cleanly closed
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kCode] = options.code === undefined ? 0 : options.code;
+ this[kReason] = options.reason === undefined ? '' : options.reason;
+ this[kWasClean] = options.wasClean === undefined ? false : options.wasClean;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get code() {
+ return this[kCode];
+ }
+
+ /**
+ * @type {String}
+ */
+ get reason() {
+ return this[kReason];
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get wasClean() {
+ return this[kWasClean];
+ }
+}
+
+Object.defineProperty(CloseEvent.prototype, 'code', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true });
+Object.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true });
+
+/**
+ * Class representing an error event.
+ *
+ * @extends Event
+ */
+class ErrorEvent extends Event {
+ /**
+ * Create a new `ErrorEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.error=null] The error that generated this event
+ * @param {String} [options.message=''] The error message
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kError] = options.error === undefined ? null : options.error;
+ this[kMessage] = options.message === undefined ? '' : options.message;
+ }
+
+ /**
+ * @type {*}
+ */
+ get error() {
+ return this[kError];
+ }
+
+ /**
+ * @type {String}
+ */
+ get message() {
+ return this[kMessage];
+ }
+}
+
+Object.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true });
+Object.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true });
+
+/**
+ * Class representing a message event.
+ *
+ * @extends Event
+ */
+class MessageEvent extends Event {
+ /**
+ * Create a new `MessageEvent`.
+ *
+ * @param {String} type The name of the event
+ * @param {Object} [options] A dictionary object that allows for setting
+ * attributes via object members of the same name
+ * @param {*} [options.data=null] The message content
+ */
+ constructor(type, options = {}) {
+ super(type);
+
+ this[kData] = options.data === undefined ? null : options.data;
+ }
+
+ /**
+ * @type {*}
+ */
+ get data() {
+ return this[kData];
+ }
+}
+
+Object.defineProperty(MessageEvent.prototype, 'data', { enumerable: true });
+
+/**
+ * This provides methods for emulating the `EventTarget` interface. It's not
+ * meant to be used directly.
+ *
+ * @mixin
+ */
+const EventTarget = {
+ /**
+ * Register an event listener.
+ *
+ * @param {String} type A string representing the event type to listen for
+ * @param {(Function|Object)} handler The listener to add
+ * @param {Object} [options] An options object specifies characteristics about
+ * the event listener
+ * @param {Boolean} [options.once=false] A `Boolean` indicating that the
+ * listener should be invoked at most once after being added. If `true`,
+ * the listener would be automatically removed when invoked.
+ * @public
+ */
+ addEventListener(type, handler, options = {}) {
+ for (const listener of this.listeners(type)) {
+ if (
+ !options[kForOnEventAttribute] &&
+ listener[kListener] === handler &&
+ !listener[kForOnEventAttribute]
+ ) {
+ return;
+ }
+ }
+
+ let wrapper;
+
+ if (type === 'message') {
+ wrapper = function onMessage(data, isBinary) {
+ const event = new MessageEvent('message', {
+ data: isBinary ? data : data.toString()
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'close') {
+ wrapper = function onClose(code, message) {
+ const event = new CloseEvent('close', {
+ code,
+ reason: message.toString(),
+ wasClean: this._closeFrameReceived && this._closeFrameSent
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'error') {
+ wrapper = function onError(error) {
+ const event = new ErrorEvent('error', {
+ error,
+ message: error.message
+ });
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else if (type === 'open') {
+ wrapper = function onOpen() {
+ const event = new Event('open');
+
+ event[kTarget] = this;
+ callListener(handler, this, event);
+ };
+ } else {
+ return;
+ }
+
+ wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
+ wrapper[kListener] = handler;
+
+ if (options.once) {
+ this.once(type, wrapper);
+ } else {
+ this.on(type, wrapper);
+ }
+ },
+
+ /**
+ * Remove an event listener.
+ *
+ * @param {String} type A string representing the event type to remove
+ * @param {(Function|Object)} handler The listener to remove
+ * @public
+ */
+ removeEventListener(type, handler) {
+ for (const listener of this.listeners(type)) {
+ if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {
+ this.removeListener(type, listener);
+ break;
+ }
+ }
+ }
+};
+
+module.exports = {
+ CloseEvent,
+ ErrorEvent,
+ Event,
+ EventTarget,
+ MessageEvent
+};
+
+/**
+ * Call an event listener
+ *
+ * @param {(Function|Object)} listener The listener to call
+ * @param {*} thisArg The value to use as `this`` when calling the listener
+ * @param {Event} event The event to pass to the listener
+ * @private
+ */
+function callListener(listener, thisArg, event) {
+ if (typeof listener === 'object' && listener.handleEvent) {
+ listener.handleEvent.call(listener, event);
+ } else {
+ listener.call(thisArg, event);
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/extension.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/extension.js"
new file mode 100644
index 0000000..3d7895c
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/extension.js"
@@ -0,0 +1,203 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Adds an offer to the map of extension offers or a parameter to the map of
+ * parameters.
+ *
+ * @param {Object} dest The map of extension offers or parameters
+ * @param {String} name The extension or parameter name
+ * @param {(Object|Boolean|String)} elem The extension parameters or the
+ * parameter value
+ * @private
+ */
+function push(dest, name, elem) {
+ if (dest[name] === undefined) dest[name] = [elem];
+ else dest[name].push(elem);
+}
+
+/**
+ * Parses the `Sec-WebSocket-Extensions` header into an object.
+ *
+ * @param {String} header The field value of the header
+ * @return {Object} The parsed object
+ * @public
+ */
+function parse(header) {
+ const offers = Object.create(null);
+ let params = Object.create(null);
+ let mustUnescape = false;
+ let isEscaping = false;
+ let inQuotes = false;
+ let extensionName;
+ let paramName;
+ let start = -1;
+ let code = -1;
+ let end = -1;
+ let i = 0;
+
+ for (; i < header.length; i++) {
+ code = header.charCodeAt(i);
+
+ if (extensionName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ const name = header.slice(start, end);
+ if (code === 0x2c) {
+ push(offers, name, params);
+ params = Object.create(null);
+ } else {
+ extensionName = name;
+ }
+
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (paramName === undefined) {
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x20 || code === 0x09) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ push(params, header.slice(start, end), true);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ start = end = -1;
+ } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {
+ paramName = header.slice(start, i);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else {
+ //
+ // The value of a quoted-string after unescaping must conform to the
+ // token ABNF, so only token characters are valid.
+ // Ref: https://tools.ietf.org/html/rfc6455#section-9.1
+ //
+ if (isEscaping) {
+ if (tokenChars[code] !== 1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ if (start === -1) start = i;
+ else if (!mustUnescape) mustUnescape = true;
+ isEscaping = false;
+ } else if (inQuotes) {
+ if (tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (code === 0x22 /* '"' */ && start !== -1) {
+ inQuotes = false;
+ end = i;
+ } else if (code === 0x5c /* '\' */) {
+ isEscaping = true;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {
+ inQuotes = true;
+ } else if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (start !== -1 && (code === 0x20 || code === 0x09)) {
+ if (end === -1) end = i;
+ } else if (code === 0x3b || code === 0x2c) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+ let value = header.slice(start, end);
+ if (mustUnescape) {
+ value = value.replace(/\\/g, '');
+ mustUnescape = false;
+ }
+ push(params, paramName, value);
+ if (code === 0x2c) {
+ push(offers, extensionName, params);
+ params = Object.create(null);
+ extensionName = undefined;
+ }
+
+ paramName = undefined;
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+ }
+
+ if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ if (end === -1) end = i;
+ const token = header.slice(start, end);
+ if (extensionName === undefined) {
+ push(offers, token, params);
+ } else {
+ if (paramName === undefined) {
+ push(params, token, true);
+ } else if (mustUnescape) {
+ push(params, paramName, token.replace(/\\/g, ''));
+ } else {
+ push(params, paramName, token);
+ }
+ push(offers, extensionName, params);
+ }
+
+ return offers;
+}
+
+/**
+ * Builds the `Sec-WebSocket-Extensions` header field value.
+ *
+ * @param {Object} extensions The map of extensions and parameters to format
+ * @return {String} A string representing the given object
+ * @public
+ */
+function format(extensions) {
+ return Object.keys(extensions)
+ .map((extension) => {
+ let configurations = extensions[extension];
+ if (!Array.isArray(configurations)) configurations = [configurations];
+ return configurations
+ .map((params) => {
+ return [extension]
+ .concat(
+ Object.keys(params).map((k) => {
+ let values = params[k];
+ if (!Array.isArray(values)) values = [values];
+ return values
+ .map((v) => (v === true ? k : `${k}=${v}`))
+ .join('; ');
+ })
+ )
+ .join('; ');
+ })
+ .join(', ');
+ })
+ .join(', ');
+}
+
+module.exports = { format, parse };
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/limiter.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/limiter.js"
new file mode 100644
index 0000000..3fd3578
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/limiter.js"
@@ -0,0 +1,55 @@
+'use strict';
+
+const kDone = Symbol('kDone');
+const kRun = Symbol('kRun');
+
+/**
+ * A very simple job queue with adjustable concurrency. Adapted from
+ * https://github.com/STRML/async-limiter
+ */
+class Limiter {
+ /**
+ * Creates a new `Limiter`.
+ *
+ * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
+ * to run concurrently
+ */
+ constructor(concurrency) {
+ this[kDone] = () => {
+ this.pending--;
+ this[kRun]();
+ };
+ this.concurrency = concurrency || Infinity;
+ this.jobs = [];
+ this.pending = 0;
+ }
+
+ /**
+ * Adds a job to the queue.
+ *
+ * @param {Function} job The job to run
+ * @public
+ */
+ add(job) {
+ this.jobs.push(job);
+ this[kRun]();
+ }
+
+ /**
+ * Removes a job from the queue and runs it if possible.
+ *
+ * @private
+ */
+ [kRun]() {
+ if (this.pending === this.concurrency) return;
+
+ if (this.jobs.length) {
+ const job = this.jobs.shift();
+
+ this.pending++;
+ job(this[kDone]);
+ }
+ }
+}
+
+module.exports = Limiter;
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/permessage-deflate.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/permessage-deflate.js"
new file mode 100644
index 0000000..77d918b
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/permessage-deflate.js"
@@ -0,0 +1,514 @@
+'use strict';
+
+const zlib = require('zlib');
+
+const bufferUtil = require('./buffer-util');
+const Limiter = require('./limiter');
+const { kStatusCode } = require('./constants');
+
+const FastBuffer = Buffer[Symbol.species];
+const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
+const kPerMessageDeflate = Symbol('permessage-deflate');
+const kTotalLength = Symbol('total-length');
+const kCallback = Symbol('callback');
+const kBuffers = Symbol('buffers');
+const kError = Symbol('error');
+
+//
+// We limit zlib concurrency, which prevents severe memory fragmentation
+// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
+// and https://github.com/websockets/ws/issues/1202
+//
+// Intentionally global; it's the global thread pool that's an issue.
+//
+let zlibLimiter;
+
+/**
+ * permessage-deflate implementation.
+ */
+class PerMessageDeflate {
+ /**
+ * Creates a PerMessageDeflate instance.
+ *
+ * @param {Object} [options] Configuration options
+ * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
+ * for, or request, a custom client window size
+ * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
+ * acknowledge disabling of client context takeover
+ * @param {Number} [options.concurrencyLimit=10] The number of concurrent
+ * calls to zlib
+ * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
+ * use of a custom server window size
+ * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
+ * disabling of server context takeover
+ * @param {Number} [options.threshold=1024] Size (in bytes) below which
+ * messages should not be compressed if context takeover is disabled
+ * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
+ * deflate
+ * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
+ * inflate
+ * @param {Boolean} [isServer=false] Create the instance in either server or
+ * client mode
+ * @param {Number} [maxPayload=0] The maximum allowed message length
+ */
+ constructor(options, isServer, maxPayload) {
+ this._maxPayload = maxPayload | 0;
+ this._options = options || {};
+ this._threshold =
+ this._options.threshold !== undefined ? this._options.threshold : 1024;
+ this._isServer = !!isServer;
+ this._deflate = null;
+ this._inflate = null;
+
+ this.params = null;
+
+ if (!zlibLimiter) {
+ const concurrency =
+ this._options.concurrencyLimit !== undefined
+ ? this._options.concurrencyLimit
+ : 10;
+ zlibLimiter = new Limiter(concurrency);
+ }
+ }
+
+ /**
+ * @type {String}
+ */
+ static get extensionName() {
+ return 'permessage-deflate';
+ }
+
+ /**
+ * Create an extension negotiation offer.
+ *
+ * @return {Object} Extension parameters
+ * @public
+ */
+ offer() {
+ const params = {};
+
+ if (this._options.serverNoContextTakeover) {
+ params.server_no_context_takeover = true;
+ }
+ if (this._options.clientNoContextTakeover) {
+ params.client_no_context_takeover = true;
+ }
+ if (this._options.serverMaxWindowBits) {
+ params.server_max_window_bits = this._options.serverMaxWindowBits;
+ }
+ if (this._options.clientMaxWindowBits) {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ } else if (this._options.clientMaxWindowBits == null) {
+ params.client_max_window_bits = true;
+ }
+
+ return params;
+ }
+
+ /**
+ * Accept an extension negotiation offer/response.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Object} Accepted configuration
+ * @public
+ */
+ accept(configurations) {
+ configurations = this.normalizeParams(configurations);
+
+ this.params = this._isServer
+ ? this.acceptAsServer(configurations)
+ : this.acceptAsClient(configurations);
+
+ return this.params;
+ }
+
+ /**
+ * Releases all resources used by the extension.
+ *
+ * @public
+ */
+ cleanup() {
+ if (this._inflate) {
+ this._inflate.close();
+ this._inflate = null;
+ }
+
+ if (this._deflate) {
+ const callback = this._deflate[kCallback];
+
+ this._deflate.close();
+ this._deflate = null;
+
+ if (callback) {
+ callback(
+ new Error(
+ 'The deflate stream was closed while data was being processed'
+ )
+ );
+ }
+ }
+ }
+
+ /**
+ * Accept an extension negotiation offer.
+ *
+ * @param {Array} offers The extension negotiation offers
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsServer(offers) {
+ const opts = this._options;
+ const accepted = offers.find((params) => {
+ if (
+ (opts.serverNoContextTakeover === false &&
+ params.server_no_context_takeover) ||
+ (params.server_max_window_bits &&
+ (opts.serverMaxWindowBits === false ||
+ (typeof opts.serverMaxWindowBits === 'number' &&
+ opts.serverMaxWindowBits > params.server_max_window_bits))) ||
+ (typeof opts.clientMaxWindowBits === 'number' &&
+ !params.client_max_window_bits)
+ ) {
+ return false;
+ }
+
+ return true;
+ });
+
+ if (!accepted) {
+ throw new Error('None of the extension offers can be accepted');
+ }
+
+ if (opts.serverNoContextTakeover) {
+ accepted.server_no_context_takeover = true;
+ }
+ if (opts.clientNoContextTakeover) {
+ accepted.client_no_context_takeover = true;
+ }
+ if (typeof opts.serverMaxWindowBits === 'number') {
+ accepted.server_max_window_bits = opts.serverMaxWindowBits;
+ }
+ if (typeof opts.clientMaxWindowBits === 'number') {
+ accepted.client_max_window_bits = opts.clientMaxWindowBits;
+ } else if (
+ accepted.client_max_window_bits === true ||
+ opts.clientMaxWindowBits === false
+ ) {
+ delete accepted.client_max_window_bits;
+ }
+
+ return accepted;
+ }
+
+ /**
+ * Accept the extension negotiation response.
+ *
+ * @param {Array} response The extension negotiation response
+ * @return {Object} Accepted configuration
+ * @private
+ */
+ acceptAsClient(response) {
+ const params = response[0];
+
+ if (
+ this._options.clientNoContextTakeover === false &&
+ params.client_no_context_takeover
+ ) {
+ throw new Error('Unexpected parameter "client_no_context_takeover"');
+ }
+
+ if (!params.client_max_window_bits) {
+ if (typeof this._options.clientMaxWindowBits === 'number') {
+ params.client_max_window_bits = this._options.clientMaxWindowBits;
+ }
+ } else if (
+ this._options.clientMaxWindowBits === false ||
+ (typeof this._options.clientMaxWindowBits === 'number' &&
+ params.client_max_window_bits > this._options.clientMaxWindowBits)
+ ) {
+ throw new Error(
+ 'Unexpected or invalid parameter "client_max_window_bits"'
+ );
+ }
+
+ return params;
+ }
+
+ /**
+ * Normalize parameters.
+ *
+ * @param {Array} configurations The extension negotiation offers/reponse
+ * @return {Array} The offers/response with normalized parameters
+ * @private
+ */
+ normalizeParams(configurations) {
+ configurations.forEach((params) => {
+ Object.keys(params).forEach((key) => {
+ let value = params[key];
+
+ if (value.length > 1) {
+ throw new Error(`Parameter "${key}" must have only a single value`);
+ }
+
+ value = value[0];
+
+ if (key === 'client_max_window_bits') {
+ if (value !== true) {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (!this._isServer) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else if (key === 'server_max_window_bits') {
+ const num = +value;
+ if (!Number.isInteger(num) || num < 8 || num > 15) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ value = num;
+ } else if (
+ key === 'client_no_context_takeover' ||
+ key === 'server_no_context_takeover'
+ ) {
+ if (value !== true) {
+ throw new TypeError(
+ `Invalid value for parameter "${key}": ${value}`
+ );
+ }
+ } else {
+ throw new Error(`Unknown parameter "${key}"`);
+ }
+
+ params[key] = value;
+ });
+ });
+
+ return configurations;
+ }
+
+ /**
+ * Decompress data. Concurrency limited.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ decompress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._decompress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Compress data. Concurrency limited.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @public
+ */
+ compress(data, fin, callback) {
+ zlibLimiter.add((done) => {
+ this._compress(data, fin, (err, result) => {
+ done();
+ callback(err, result);
+ });
+ });
+ }
+
+ /**
+ * Decompress data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _decompress(data, fin, callback) {
+ const endpoint = this._isServer ? 'client' : 'server';
+
+ if (!this._inflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._inflate = zlib.createInflateRaw({
+ ...this._options.zlibInflateOptions,
+ windowBits
+ });
+ this._inflate[kPerMessageDeflate] = this;
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+ this._inflate.on('error', inflateOnError);
+ this._inflate.on('data', inflateOnData);
+ }
+
+ this._inflate[kCallback] = callback;
+
+ this._inflate.write(data);
+ if (fin) this._inflate.write(TRAILER);
+
+ this._inflate.flush(() => {
+ const err = this._inflate[kError];
+
+ if (err) {
+ this._inflate.close();
+ this._inflate = null;
+ callback(err);
+ return;
+ }
+
+ const data = bufferUtil.concat(
+ this._inflate[kBuffers],
+ this._inflate[kTotalLength]
+ );
+
+ if (this._inflate._readableState.endEmitted) {
+ this._inflate.close();
+ this._inflate = null;
+ } else {
+ this._inflate[kTotalLength] = 0;
+ this._inflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._inflate.reset();
+ }
+ }
+
+ callback(null, data);
+ });
+ }
+
+ /**
+ * Compress data.
+ *
+ * @param {(Buffer|String)} data Data to compress
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
+ * @param {Function} callback Callback
+ * @private
+ */
+ _compress(data, fin, callback) {
+ const endpoint = this._isServer ? 'server' : 'client';
+
+ if (!this._deflate) {
+ const key = `${endpoint}_max_window_bits`;
+ const windowBits =
+ typeof this.params[key] !== 'number'
+ ? zlib.Z_DEFAULT_WINDOWBITS
+ : this.params[key];
+
+ this._deflate = zlib.createDeflateRaw({
+ ...this._options.zlibDeflateOptions,
+ windowBits
+ });
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ this._deflate.on('data', deflateOnData);
+ }
+
+ this._deflate[kCallback] = callback;
+
+ this._deflate.write(data);
+ this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
+ if (!this._deflate) {
+ //
+ // The deflate stream was closed while data was being processed.
+ //
+ return;
+ }
+
+ let data = bufferUtil.concat(
+ this._deflate[kBuffers],
+ this._deflate[kTotalLength]
+ );
+
+ if (fin) {
+ data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
+ }
+
+ //
+ // Ensure that the callback will not be called again in
+ // `PerMessageDeflate#cleanup()`.
+ //
+ this._deflate[kCallback] = null;
+
+ this._deflate[kTotalLength] = 0;
+ this._deflate[kBuffers] = [];
+
+ if (fin && this.params[`${endpoint}_no_context_takeover`]) {
+ this._deflate.reset();
+ }
+
+ callback(null, data);
+ });
+ }
+}
+
+module.exports = PerMessageDeflate;
+
+/**
+ * The listener of the `zlib.DeflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function deflateOnData(chunk) {
+ this[kBuffers].push(chunk);
+ this[kTotalLength] += chunk.length;
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function inflateOnData(chunk) {
+ this[kTotalLength] += chunk.length;
+
+ if (
+ this[kPerMessageDeflate]._maxPayload < 1 ||
+ this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
+ ) {
+ this[kBuffers].push(chunk);
+ return;
+ }
+
+ this[kError] = new RangeError('Max payload size exceeded');
+ this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
+ this[kError][kStatusCode] = 1009;
+ this.removeListener('data', inflateOnData);
+ this.reset();
+}
+
+/**
+ * The listener of the `zlib.InflateRaw` stream `'error'` event.
+ *
+ * @param {Error} err The emitted error
+ * @private
+ */
+function inflateOnError(err) {
+ //
+ // There is no need to call `Zlib#close()` as the handle is automatically
+ // closed when an error is emitted.
+ //
+ this[kPerMessageDeflate]._inflate = null;
+ err[kStatusCode] = 1007;
+ this[kCallback](err);
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/receiver.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/receiver.js"
new file mode 100644
index 0000000..54d9b4f
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/receiver.js"
@@ -0,0 +1,706 @@
+'use strict';
+
+const { Writable } = require('stream');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ kStatusCode,
+ kWebSocket
+} = require('./constants');
+const { concat, toArrayBuffer, unmask } = require('./buffer-util');
+const { isValidStatusCode, isValidUTF8 } = require('./validation');
+
+const FastBuffer = Buffer[Symbol.species];
+
+const GET_INFO = 0;
+const GET_PAYLOAD_LENGTH_16 = 1;
+const GET_PAYLOAD_LENGTH_64 = 2;
+const GET_MASK = 3;
+const GET_DATA = 4;
+const INFLATING = 5;
+const DEFER_EVENT = 6;
+
+/**
+ * HyBi Receiver implementation.
+ *
+ * @extends Writable
+ */
+class Receiver extends Writable {
+ /**
+ * Creates a Receiver instance.
+ *
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {String} [options.binaryType=nodebuffer] The type for binary data
+ * @param {Object} [options.extensions] An object containing the negotiated
+ * extensions
+ * @param {Boolean} [options.isServer=false] Specifies whether to operate in
+ * client or server mode
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ */
+ constructor(options = {}) {
+ super();
+
+ this._allowSynchronousEvents =
+ options.allowSynchronousEvents !== undefined
+ ? options.allowSynchronousEvents
+ : true;
+ this._binaryType = options.binaryType || BINARY_TYPES[0];
+ this._extensions = options.extensions || {};
+ this._isServer = !!options.isServer;
+ this._maxPayload = options.maxPayload | 0;
+ this._skipUTF8Validation = !!options.skipUTF8Validation;
+ this[kWebSocket] = undefined;
+
+ this._bufferedBytes = 0;
+ this._buffers = [];
+
+ this._compressed = false;
+ this._payloadLength = 0;
+ this._mask = undefined;
+ this._fragmented = 0;
+ this._masked = false;
+ this._fin = false;
+ this._opcode = 0;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragments = [];
+
+ this._errored = false;
+ this._loop = false;
+ this._state = GET_INFO;
+ }
+
+ /**
+ * Implements `Writable.prototype._write()`.
+ *
+ * @param {Buffer} chunk The chunk of data to write
+ * @param {String} encoding The character encoding of `chunk`
+ * @param {Function} cb Callback
+ * @private
+ */
+ _write(chunk, encoding, cb) {
+ if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
+
+ this._bufferedBytes += chunk.length;
+ this._buffers.push(chunk);
+ this.startLoop(cb);
+ }
+
+ /**
+ * Consumes `n` bytes from the buffered data.
+ *
+ * @param {Number} n The number of bytes to consume
+ * @return {Buffer} The consumed bytes
+ * @private
+ */
+ consume(n) {
+ this._bufferedBytes -= n;
+
+ if (n === this._buffers[0].length) return this._buffers.shift();
+
+ if (n < this._buffers[0].length) {
+ const buf = this._buffers[0];
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+
+ return new FastBuffer(buf.buffer, buf.byteOffset, n);
+ }
+
+ const dst = Buffer.allocUnsafe(n);
+
+ do {
+ const buf = this._buffers[0];
+ const offset = dst.length - n;
+
+ if (n >= buf.length) {
+ dst.set(this._buffers.shift(), offset);
+ } else {
+ dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);
+ this._buffers[0] = new FastBuffer(
+ buf.buffer,
+ buf.byteOffset + n,
+ buf.length - n
+ );
+ }
+
+ n -= buf.length;
+ } while (n > 0);
+
+ return dst;
+ }
+
+ /**
+ * Starts the parsing loop.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ startLoop(cb) {
+ this._loop = true;
+
+ do {
+ switch (this._state) {
+ case GET_INFO:
+ this.getInfo(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_16:
+ this.getPayloadLength16(cb);
+ break;
+ case GET_PAYLOAD_LENGTH_64:
+ this.getPayloadLength64(cb);
+ break;
+ case GET_MASK:
+ this.getMask();
+ break;
+ case GET_DATA:
+ this.getData(cb);
+ break;
+ case INFLATING:
+ case DEFER_EVENT:
+ this._loop = false;
+ return;
+ }
+ } while (this._loop);
+
+ if (!this._errored) cb();
+ }
+
+ /**
+ * Reads the first two bytes of a frame.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getInfo(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(2);
+
+ if ((buf[0] & 0x30) !== 0x00) {
+ const error = this.createError(
+ RangeError,
+ 'RSV2 and RSV3 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_2_3'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const compressed = (buf[0] & 0x40) === 0x40;
+
+ if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fin = (buf[0] & 0x80) === 0x80;
+ this._opcode = buf[0] & 0x0f;
+ this._payloadLength = buf[1] & 0x7f;
+
+ if (this._opcode === 0x00) {
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ 'invalid opcode 0',
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._opcode = this._fragmented;
+ } else if (this._opcode === 0x01 || this._opcode === 0x02) {
+ if (this._fragmented) {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._compressed = compressed;
+ } else if (this._opcode > 0x07 && this._opcode < 0x0b) {
+ if (!this._fin) {
+ const error = this.createError(
+ RangeError,
+ 'FIN must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_FIN'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (compressed) {
+ const error = this.createError(
+ RangeError,
+ 'RSV1 must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_RSV_1'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (
+ this._payloadLength > 0x7d ||
+ (this._opcode === 0x08 && this._payloadLength === 1)
+ ) {
+ const error = this.createError(
+ RangeError,
+ `invalid payload length ${this._payloadLength}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ } else {
+ const error = this.createError(
+ RangeError,
+ `invalid opcode ${this._opcode}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_OPCODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
+ this._masked = (buf[1] & 0x80) === 0x80;
+
+ if (this._isServer) {
+ if (!this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be set',
+ true,
+ 1002,
+ 'WS_ERR_EXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+ } else if (this._masked) {
+ const error = this.createError(
+ RangeError,
+ 'MASK must be clear',
+ true,
+ 1002,
+ 'WS_ERR_UNEXPECTED_MASK'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
+ else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
+ else this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+16).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength16(cb) {
+ if (this._bufferedBytes < 2) {
+ this._loop = false;
+ return;
+ }
+
+ this._payloadLength = this.consume(2).readUInt16BE(0);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Gets extended payload length (7+64).
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getPayloadLength64(cb) {
+ if (this._bufferedBytes < 8) {
+ this._loop = false;
+ return;
+ }
+
+ const buf = this.consume(8);
+ const num = buf.readUInt32BE(0);
+
+ //
+ // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned
+ // if payload length is greater than this number.
+ //
+ if (num > Math.pow(2, 53 - 32) - 1) {
+ const error = this.createError(
+ RangeError,
+ 'Unsupported WebSocket frame: payload length > 2^53 - 1',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
+ this.haveLength(cb);
+ }
+
+ /**
+ * Payload length has been read.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ haveLength(cb) {
+ if (this._payloadLength && this._opcode < 0x08) {
+ this._totalPayloadLength += this._payloadLength;
+ if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+ }
+
+ if (this._masked) this._state = GET_MASK;
+ else this._state = GET_DATA;
+ }
+
+ /**
+ * Reads mask bytes.
+ *
+ * @private
+ */
+ getMask() {
+ if (this._bufferedBytes < 4) {
+ this._loop = false;
+ return;
+ }
+
+ this._mask = this.consume(4);
+ this._state = GET_DATA;
+ }
+
+ /**
+ * Reads data bytes.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ getData(cb) {
+ let data = EMPTY_BUFFER;
+
+ if (this._payloadLength) {
+ if (this._bufferedBytes < this._payloadLength) {
+ this._loop = false;
+ return;
+ }
+
+ data = this.consume(this._payloadLength);
+
+ if (
+ this._masked &&
+ (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0
+ ) {
+ unmask(data, this._mask);
+ }
+ }
+
+ if (this._opcode > 0x07) {
+ this.controlMessage(data, cb);
+ return;
+ }
+
+ if (this._compressed) {
+ this._state = INFLATING;
+ this.decompress(data, cb);
+ return;
+ }
+
+ if (data.length) {
+ //
+ // This message is not compressed so its length is the sum of the payload
+ // length of all fragments.
+ //
+ this._messageLength = this._totalPayloadLength;
+ this._fragments.push(data);
+ }
+
+ this.dataMessage(cb);
+ }
+
+ /**
+ * Decompresses data.
+ *
+ * @param {Buffer} data Compressed data
+ * @param {Function} cb Callback
+ * @private
+ */
+ decompress(data, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ perMessageDeflate.decompress(data, this._fin, (err, buf) => {
+ if (err) return cb(err);
+
+ if (buf.length) {
+ this._messageLength += buf.length;
+ if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
+ const error = this.createError(
+ RangeError,
+ 'Max payload size exceeded',
+ false,
+ 1009,
+ 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._fragments.push(buf);
+ }
+
+ this.dataMessage(cb);
+ if (this._state === GET_INFO) this.startLoop(cb);
+ });
+ }
+
+ /**
+ * Handles a data message.
+ *
+ * @param {Function} cb Callback
+ * @private
+ */
+ dataMessage(cb) {
+ if (!this._fin) {
+ this._state = GET_INFO;
+ return;
+ }
+
+ const messageLength = this._messageLength;
+ const fragments = this._fragments;
+
+ this._totalPayloadLength = 0;
+ this._messageLength = 0;
+ this._fragmented = 0;
+ this._fragments = [];
+
+ if (this._opcode === 2) {
+ let data;
+
+ if (this._binaryType === 'nodebuffer') {
+ data = concat(fragments, messageLength);
+ } else if (this._binaryType === 'arraybuffer') {
+ data = toArrayBuffer(concat(fragments, messageLength));
+ } else if (this._binaryType === 'blob') {
+ data = new Blob(fragments);
+ } else {
+ data = fragments;
+ }
+
+ if (this._allowSynchronousEvents) {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ setImmediate(() => {
+ this.emit('message', data, true);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ } else {
+ const buf = concat(fragments, messageLength);
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ if (this._state === INFLATING || this._allowSynchronousEvents) {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ setImmediate(() => {
+ this.emit('message', buf, false);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+ }
+
+ /**
+ * Handles a control message.
+ *
+ * @param {Buffer} data Data to handle
+ * @return {(Error|RangeError|undefined)} A possible error
+ * @private
+ */
+ controlMessage(data, cb) {
+ if (this._opcode === 0x08) {
+ if (data.length === 0) {
+ this._loop = false;
+ this.emit('conclude', 1005, EMPTY_BUFFER);
+ this.end();
+ } else {
+ const code = data.readUInt16BE(0);
+
+ if (!isValidStatusCode(code)) {
+ const error = this.createError(
+ RangeError,
+ `invalid status code ${code}`,
+ true,
+ 1002,
+ 'WS_ERR_INVALID_CLOSE_CODE'
+ );
+
+ cb(error);
+ return;
+ }
+
+ const buf = new FastBuffer(
+ data.buffer,
+ data.byteOffset + 2,
+ data.length - 2
+ );
+
+ if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
+ const error = this.createError(
+ Error,
+ 'invalid UTF-8 sequence',
+ true,
+ 1007,
+ 'WS_ERR_INVALID_UTF8'
+ );
+
+ cb(error);
+ return;
+ }
+
+ this._loop = false;
+ this.emit('conclude', code, buf);
+ this.end();
+ }
+
+ this._state = GET_INFO;
+ return;
+ }
+
+ if (this._allowSynchronousEvents) {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ } else {
+ this._state = DEFER_EVENT;
+ setImmediate(() => {
+ this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);
+ this._state = GET_INFO;
+ this.startLoop(cb);
+ });
+ }
+ }
+
+ /**
+ * Builds an error object.
+ *
+ * @param {function(new:Error|RangeError)} ErrorCtor The error constructor
+ * @param {String} message The error message
+ * @param {Boolean} prefix Specifies whether or not to add a default prefix to
+ * `message`
+ * @param {Number} statusCode The status code
+ * @param {String} errorCode The exposed error code
+ * @return {(Error|RangeError)} The error
+ * @private
+ */
+ createError(ErrorCtor, message, prefix, statusCode, errorCode) {
+ this._loop = false;
+ this._errored = true;
+
+ const err = new ErrorCtor(
+ prefix ? `Invalid WebSocket frame: ${message}` : message
+ );
+
+ Error.captureStackTrace(err, this.createError);
+ err.code = errorCode;
+ err[kStatusCode] = statusCode;
+ return err;
+ }
+}
+
+module.exports = Receiver;
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/sender.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/sender.js"
new file mode 100644
index 0000000..ee16cea
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/sender.js"
@@ -0,0 +1,602 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */
+
+'use strict';
+
+const { Duplex } = require('stream');
+const { randomFillSync } = require('crypto');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const { EMPTY_BUFFER, kWebSocket, NOOP } = require('./constants');
+const { isBlob, isValidStatusCode } = require('./validation');
+const { mask: applyMask, toBuffer } = require('./buffer-util');
+
+const kByteLength = Symbol('kByteLength');
+const maskBuffer = Buffer.alloc(4);
+const RANDOM_POOL_SIZE = 8 * 1024;
+let randomPool;
+let randomPoolPointer = RANDOM_POOL_SIZE;
+
+const DEFAULT = 0;
+const DEFLATING = 1;
+const GET_BLOB_DATA = 2;
+
+/**
+ * HyBi Sender implementation.
+ */
+class Sender {
+ /**
+ * Creates a Sender instance.
+ *
+ * @param {Duplex} socket The connection socket
+ * @param {Object} [extensions] An object containing the negotiated extensions
+ * @param {Function} [generateMask] The function used to generate the masking
+ * key
+ */
+ constructor(socket, extensions, generateMask) {
+ this._extensions = extensions || {};
+
+ if (generateMask) {
+ this._generateMask = generateMask;
+ this._maskBuffer = Buffer.alloc(4);
+ }
+
+ this._socket = socket;
+
+ this._firstFragment = true;
+ this._compress = false;
+
+ this._bufferedBytes = 0;
+ this._queue = [];
+ this._state = DEFAULT;
+ this.onerror = NOOP;
+ this[kWebSocket] = undefined;
+ }
+
+ /**
+ * Frames a piece of data according to the HyBi WebSocket protocol.
+ *
+ * @param {(Buffer|String)} data The data to frame
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @return {(Buffer|String)[]} The framed data
+ * @public
+ */
+ static frame(data, options) {
+ let mask;
+ let merge = false;
+ let offset = 2;
+ let skipMasking = false;
+
+ if (options.mask) {
+ mask = options.maskBuffer || maskBuffer;
+
+ if (options.generateMask) {
+ options.generateMask(mask);
+ } else {
+ if (randomPoolPointer === RANDOM_POOL_SIZE) {
+ /* istanbul ignore else */
+ if (randomPool === undefined) {
+ //
+ // This is lazily initialized because server-sent frames must not
+ // be masked so it may never be used.
+ //
+ randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
+ }
+
+ randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);
+ randomPoolPointer = 0;
+ }
+
+ mask[0] = randomPool[randomPoolPointer++];
+ mask[1] = randomPool[randomPoolPointer++];
+ mask[2] = randomPool[randomPoolPointer++];
+ mask[3] = randomPool[randomPoolPointer++];
+ }
+
+ skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
+ offset = 6;
+ }
+
+ let dataLength;
+
+ if (typeof data === 'string') {
+ if (
+ (!options.mask || skipMasking) &&
+ options[kByteLength] !== undefined
+ ) {
+ dataLength = options[kByteLength];
+ } else {
+ data = Buffer.from(data);
+ dataLength = data.length;
+ }
+ } else {
+ dataLength = data.length;
+ merge = options.mask && options.readOnly && !skipMasking;
+ }
+
+ let payloadLength = dataLength;
+
+ if (dataLength >= 65536) {
+ offset += 8;
+ payloadLength = 127;
+ } else if (dataLength > 125) {
+ offset += 2;
+ payloadLength = 126;
+ }
+
+ const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
+
+ target[0] = options.fin ? options.opcode | 0x80 : options.opcode;
+ if (options.rsv1) target[0] |= 0x40;
+
+ target[1] = payloadLength;
+
+ if (payloadLength === 126) {
+ target.writeUInt16BE(dataLength, 2);
+ } else if (payloadLength === 127) {
+ target[2] = target[3] = 0;
+ target.writeUIntBE(dataLength, 4, 6);
+ }
+
+ if (!options.mask) return [target, data];
+
+ target[1] |= 0x80;
+ target[offset - 4] = mask[0];
+ target[offset - 3] = mask[1];
+ target[offset - 2] = mask[2];
+ target[offset - 1] = mask[3];
+
+ if (skipMasking) return [target, data];
+
+ if (merge) {
+ applyMask(data, mask, target, offset, dataLength);
+ return [target];
+ }
+
+ applyMask(data, mask, data, 0, dataLength);
+ return [target, data];
+ }
+
+ /**
+ * Sends a close message to the other peer.
+ *
+ * @param {Number} [code] The status code component of the body
+ * @param {(String|Buffer)} [data] The message component of the body
+ * @param {Boolean} [mask=false] Specifies whether or not to mask the message
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ close(code, data, mask, cb) {
+ let buf;
+
+ if (code === undefined) {
+ buf = EMPTY_BUFFER;
+ } else if (typeof code !== 'number' || !isValidStatusCode(code)) {
+ throw new TypeError('First argument must be a valid error code number');
+ } else if (data === undefined || !data.length) {
+ buf = Buffer.allocUnsafe(2);
+ buf.writeUInt16BE(code, 0);
+ } else {
+ const length = Buffer.byteLength(data);
+
+ if (length > 123) {
+ throw new RangeError('The message must not be greater than 123 bytes');
+ }
+
+ buf = Buffer.allocUnsafe(2 + length);
+ buf.writeUInt16BE(code, 0);
+
+ if (typeof data === 'string') {
+ buf.write(data, 2);
+ } else {
+ buf.set(data, 2);
+ }
+ }
+
+ const options = {
+ [kByteLength]: buf.length,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x08,
+ readOnly: false,
+ rsv1: false
+ };
+
+ if (this._state !== DEFAULT) {
+ this.enqueue([this.dispatch, buf, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(buf, options), cb);
+ }
+ }
+
+ /**
+ * Sends a ping message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ ping(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else if (isBlob(data)) {
+ byteLength = data.size;
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x09,
+ readOnly,
+ rsv1: false
+ };
+
+ if (isBlob(data)) {
+ if (this._state !== DEFAULT) {
+ this.enqueue([this.getBlobData, data, false, options, cb]);
+ } else {
+ this.getBlobData(data, false, options, cb);
+ }
+ } else if (this._state !== DEFAULT) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a pong message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ pong(data, mask, cb) {
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else if (isBlob(data)) {
+ byteLength = data.size;
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (byteLength > 125) {
+ throw new RangeError('The data size must not be greater than 125 bytes');
+ }
+
+ const options = {
+ [kByteLength]: byteLength,
+ fin: true,
+ generateMask: this._generateMask,
+ mask,
+ maskBuffer: this._maskBuffer,
+ opcode: 0x0a,
+ readOnly,
+ rsv1: false
+ };
+
+ if (isBlob(data)) {
+ if (this._state !== DEFAULT) {
+ this.enqueue([this.getBlobData, data, false, options, cb]);
+ } else {
+ this.getBlobData(data, false, options, cb);
+ }
+ } else if (this._state !== DEFAULT) {
+ this.enqueue([this.dispatch, data, false, options, cb]);
+ } else {
+ this.sendFrame(Sender.frame(data, options), cb);
+ }
+ }
+
+ /**
+ * Sends a data message to the other peer.
+ *
+ * @param {*} data The message to send
+ * @param {Object} options Options object
+ * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
+ * or text
+ * @param {Boolean} [options.compress=false] Specifies whether or not to
+ * compress `data`
+ * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Function} [cb] Callback
+ * @public
+ */
+ send(data, options, cb) {
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+ let opcode = options.binary ? 2 : 1;
+ let rsv1 = options.compress;
+
+ let byteLength;
+ let readOnly;
+
+ if (typeof data === 'string') {
+ byteLength = Buffer.byteLength(data);
+ readOnly = false;
+ } else if (isBlob(data)) {
+ byteLength = data.size;
+ readOnly = false;
+ } else {
+ data = toBuffer(data);
+ byteLength = data.length;
+ readOnly = toBuffer.readOnly;
+ }
+
+ if (this._firstFragment) {
+ this._firstFragment = false;
+ if (
+ rsv1 &&
+ perMessageDeflate &&
+ perMessageDeflate.params[
+ perMessageDeflate._isServer
+ ? 'server_no_context_takeover'
+ : 'client_no_context_takeover'
+ ]
+ ) {
+ rsv1 = byteLength >= perMessageDeflate._threshold;
+ }
+ this._compress = rsv1;
+ } else {
+ rsv1 = false;
+ opcode = 0;
+ }
+
+ if (options.fin) this._firstFragment = true;
+
+ const opts = {
+ [kByteLength]: byteLength,
+ fin: options.fin,
+ generateMask: this._generateMask,
+ mask: options.mask,
+ maskBuffer: this._maskBuffer,
+ opcode,
+ readOnly,
+ rsv1
+ };
+
+ if (isBlob(data)) {
+ if (this._state !== DEFAULT) {
+ this.enqueue([this.getBlobData, data, this._compress, opts, cb]);
+ } else {
+ this.getBlobData(data, this._compress, opts, cb);
+ }
+ } else if (this._state !== DEFAULT) {
+ this.enqueue([this.dispatch, data, this._compress, opts, cb]);
+ } else {
+ this.dispatch(data, this._compress, opts, cb);
+ }
+ }
+
+ /**
+ * Gets the contents of a blob as binary data.
+ *
+ * @param {Blob} blob The blob
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
+ * the data
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ getBlobData(blob, compress, options, cb) {
+ this._bufferedBytes += options[kByteLength];
+ this._state = GET_BLOB_DATA;
+
+ blob
+ .arrayBuffer()
+ .then((arrayBuffer) => {
+ if (this._socket.destroyed) {
+ const err = new Error(
+ 'The socket was closed while the blob was being read'
+ );
+
+ //
+ // `callCallbacks` is called in the next tick to ensure that errors
+ // that might be thrown in the callbacks behave like errors thrown
+ // outside the promise chain.
+ //
+ process.nextTick(callCallbacks, this, err, cb);
+ return;
+ }
+
+ this._bufferedBytes -= options[kByteLength];
+ const data = toBuffer(arrayBuffer);
+
+ if (!compress) {
+ this._state = DEFAULT;
+ this.sendFrame(Sender.frame(data, options), cb);
+ this.dequeue();
+ } else {
+ this.dispatch(data, compress, options, cb);
+ }
+ })
+ .catch((err) => {
+ //
+ // `onError` is called in the next tick for the same reason that
+ // `callCallbacks` above is.
+ //
+ process.nextTick(onError, this, err, cb);
+ });
+ }
+
+ /**
+ * Dispatches a message.
+ *
+ * @param {(Buffer|String)} data The message to send
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
+ * `data`
+ * @param {Object} options Options object
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
+ * FIN bit
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
+ * `data`
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
+ * key
+ * @param {Number} options.opcode The opcode
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
+ * modified
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
+ * RSV1 bit
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ dispatch(data, compress, options, cb) {
+ if (!compress) {
+ this.sendFrame(Sender.frame(data, options), cb);
+ return;
+ }
+
+ const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
+
+ this._bufferedBytes += options[kByteLength];
+ this._state = DEFLATING;
+ perMessageDeflate.compress(data, options.fin, (_, buf) => {
+ if (this._socket.destroyed) {
+ const err = new Error(
+ 'The socket was closed while data was being compressed'
+ );
+
+ callCallbacks(this, err, cb);
+ return;
+ }
+
+ this._bufferedBytes -= options[kByteLength];
+ this._state = DEFAULT;
+ options.readOnly = false;
+ this.sendFrame(Sender.frame(buf, options), cb);
+ this.dequeue();
+ });
+ }
+
+ /**
+ * Executes queued send operations.
+ *
+ * @private
+ */
+ dequeue() {
+ while (this._state === DEFAULT && this._queue.length) {
+ const params = this._queue.shift();
+
+ this._bufferedBytes -= params[3][kByteLength];
+ Reflect.apply(params[0], this, params.slice(1));
+ }
+ }
+
+ /**
+ * Enqueues a send operation.
+ *
+ * @param {Array} params Send operation parameters.
+ * @private
+ */
+ enqueue(params) {
+ this._bufferedBytes += params[3][kByteLength];
+ this._queue.push(params);
+ }
+
+ /**
+ * Sends a frame.
+ *
+ * @param {Buffer[]} list The frame to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+ sendFrame(list, cb) {
+ if (list.length === 2) {
+ this._socket.cork();
+ this._socket.write(list[0]);
+ this._socket.write(list[1], cb);
+ this._socket.uncork();
+ } else {
+ this._socket.write(list[0], cb);
+ }
+ }
+}
+
+module.exports = Sender;
+
+/**
+ * Calls queued callbacks with an error.
+ *
+ * @param {Sender} sender The `Sender` instance
+ * @param {Error} err The error to call the callbacks with
+ * @param {Function} [cb] The first callback
+ * @private
+ */
+function callCallbacks(sender, err, cb) {
+ if (typeof cb === 'function') cb(err);
+
+ for (let i = 0; i < sender._queue.length; i++) {
+ const params = sender._queue[i];
+ const callback = params[params.length - 1];
+
+ if (typeof callback === 'function') callback(err);
+ }
+}
+
+/**
+ * Handles a `Sender` error.
+ *
+ * @param {Sender} sender The `Sender` instance
+ * @param {Error} err The error
+ * @param {Function} [cb] The first pending callback
+ * @private
+ */
+function onError(sender, err, cb) {
+ callCallbacks(sender, err, cb);
+ sender.onerror(err);
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/stream.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/stream.js"
new file mode 100644
index 0000000..230734b
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/stream.js"
@@ -0,0 +1,159 @@
+'use strict';
+
+const { Duplex } = require('stream');
+
+/**
+ * Emits the `'close'` event on a stream.
+ *
+ * @param {Duplex} stream The stream.
+ * @private
+ */
+function emitClose(stream) {
+ stream.emit('close');
+}
+
+/**
+ * The listener of the `'end'` event.
+ *
+ * @private
+ */
+function duplexOnEnd() {
+ if (!this.destroyed && this._writableState.finished) {
+ this.destroy();
+ }
+}
+
+/**
+ * The listener of the `'error'` event.
+ *
+ * @param {Error} err The error
+ * @private
+ */
+function duplexOnError(err) {
+ this.removeListener('error', duplexOnError);
+ this.destroy();
+ if (this.listenerCount('error') === 0) {
+ // Do not suppress the throwing behavior.
+ this.emit('error', err);
+ }
+}
+
+/**
+ * Wraps a `WebSocket` in a duplex stream.
+ *
+ * @param {WebSocket} ws The `WebSocket` to wrap
+ * @param {Object} [options] The options for the `Duplex` constructor
+ * @return {Duplex} The duplex stream
+ * @public
+ */
+function createWebSocketStream(ws, options) {
+ let terminateOnDestroy = true;
+
+ const duplex = new Duplex({
+ ...options,
+ autoDestroy: false,
+ emitClose: false,
+ objectMode: false,
+ writableObjectMode: false
+ });
+
+ ws.on('message', function message(msg, isBinary) {
+ const data =
+ !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
+
+ if (!duplex.push(data)) ws.pause();
+ });
+
+ ws.once('error', function error(err) {
+ if (duplex.destroyed) return;
+
+ // Prevent `ws.terminate()` from being called by `duplex._destroy()`.
+ //
+ // - If the `'error'` event is emitted before the `'open'` event, then
+ // `ws.terminate()` is a noop as no socket is assigned.
+ // - Otherwise, the error is re-emitted by the listener of the `'error'`
+ // event of the `Receiver` object. The listener already closes the
+ // connection by calling `ws.close()`. This allows a close frame to be
+ // sent to the other peer. If `ws.terminate()` is called right after this,
+ // then the close frame might not be sent.
+ terminateOnDestroy = false;
+ duplex.destroy(err);
+ });
+
+ ws.once('close', function close() {
+ if (duplex.destroyed) return;
+
+ duplex.push(null);
+ });
+
+ duplex._destroy = function (err, callback) {
+ if (ws.readyState === ws.CLOSED) {
+ callback(err);
+ process.nextTick(emitClose, duplex);
+ return;
+ }
+
+ let called = false;
+
+ ws.once('error', function error(err) {
+ called = true;
+ callback(err);
+ });
+
+ ws.once('close', function close() {
+ if (!called) callback(err);
+ process.nextTick(emitClose, duplex);
+ });
+
+ if (terminateOnDestroy) ws.terminate();
+ };
+
+ duplex._final = function (callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._final(callback);
+ });
+ return;
+ }
+
+ // If the value of the `_socket` property is `null` it means that `ws` is a
+ // client websocket and the handshake failed. In fact, when this happens, a
+ // socket is never assigned to the websocket. Wait for the `'error'` event
+ // that will be emitted by the websocket.
+ if (ws._socket === null) return;
+
+ if (ws._socket._writableState.finished) {
+ callback();
+ if (duplex._readableState.endEmitted) duplex.destroy();
+ } else {
+ ws._socket.once('finish', function finish() {
+ // `duplex` is not destroyed here because the `'end'` event will be
+ // emitted on `duplex` after this `'finish'` event. The EOF signaling
+ // `null` chunk is, in fact, pushed when the websocket emits `'close'`.
+ callback();
+ });
+ ws.close();
+ }
+ };
+
+ duplex._read = function () {
+ if (ws.isPaused) ws.resume();
+ };
+
+ duplex._write = function (chunk, encoding, callback) {
+ if (ws.readyState === ws.CONNECTING) {
+ ws.once('open', function open() {
+ duplex._write(chunk, encoding, callback);
+ });
+ return;
+ }
+
+ ws.send(chunk, callback);
+ };
+
+ duplex.on('end', duplexOnEnd);
+ duplex.on('error', duplexOnError);
+ return duplex;
+}
+
+module.exports = createWebSocketStream;
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/subprotocol.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/subprotocol.js"
new file mode 100644
index 0000000..d4381e8
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/subprotocol.js"
@@ -0,0 +1,62 @@
+'use strict';
+
+const { tokenChars } = require('./validation');
+
+/**
+ * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.
+ *
+ * @param {String} header The field value of the header
+ * @return {Set} The subprotocol names
+ * @public
+ */
+function parse(header) {
+ const protocols = new Set();
+ let start = -1;
+ let end = -1;
+ let i = 0;
+
+ for (i; i < header.length; i++) {
+ const code = header.charCodeAt(i);
+
+ if (end === -1 && tokenChars[code] === 1) {
+ if (start === -1) start = i;
+ } else if (
+ i !== 0 &&
+ (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
+ ) {
+ if (end === -1 && start !== -1) end = i;
+ } else if (code === 0x2c /* ',' */) {
+ if (start === -1) {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+
+ if (end === -1) end = i;
+
+ const protocol = header.slice(start, end);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ start = end = -1;
+ } else {
+ throw new SyntaxError(`Unexpected character at index ${i}`);
+ }
+ }
+
+ if (start === -1 || end !== -1) {
+ throw new SyntaxError('Unexpected end of input');
+ }
+
+ const protocol = header.slice(start, i);
+
+ if (protocols.has(protocol)) {
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
+ }
+
+ protocols.add(protocol);
+ return protocols;
+}
+
+module.exports = { parse };
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/validation.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/validation.js"
new file mode 100644
index 0000000..4a2e68d
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/validation.js"
@@ -0,0 +1,152 @@
+'use strict';
+
+const { isUtf8 } = require('buffer');
+
+const { hasBlob } = require('./constants');
+
+//
+// Allowed token characters:
+//
+// '!', '#', '$', '%', '&', ''', '*', '+', '-',
+// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'
+//
+// tokenChars[32] === 0 // ' '
+// tokenChars[33] === 1 // '!'
+// tokenChars[34] === 0 // '"'
+// ...
+//
+// prettier-ignore
+const tokenChars = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127
+];
+
+/**
+ * Checks if a status code is allowed in a close frame.
+ *
+ * @param {Number} code The status code
+ * @return {Boolean} `true` if the status code is valid, else `false`
+ * @public
+ */
+function isValidStatusCode(code) {
+ return (
+ (code >= 1000 &&
+ code <= 1014 &&
+ code !== 1004 &&
+ code !== 1005 &&
+ code !== 1006) ||
+ (code >= 3000 && code <= 4999)
+ );
+}
+
+/**
+ * Checks if a given buffer contains only correct UTF-8.
+ * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by
+ * Markus Kuhn.
+ *
+ * @param {Buffer} buf The buffer to check
+ * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`
+ * @public
+ */
+function _isValidUTF8(buf) {
+ const len = buf.length;
+ let i = 0;
+
+ while (i < len) {
+ if ((buf[i] & 0x80) === 0) {
+ // 0xxxxxxx
+ i++;
+ } else if ((buf[i] & 0xe0) === 0xc0) {
+ // 110xxxxx 10xxxxxx
+ if (
+ i + 1 === len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i] & 0xfe) === 0xc0 // Overlong
+ ) {
+ return false;
+ }
+
+ i += 2;
+ } else if ((buf[i] & 0xf0) === 0xe0) {
+ // 1110xxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 2 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong
+ (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)
+ ) {
+ return false;
+ }
+
+ i += 3;
+ } else if ((buf[i] & 0xf8) === 0xf0) {
+ // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ if (
+ i + 3 >= len ||
+ (buf[i + 1] & 0xc0) !== 0x80 ||
+ (buf[i + 2] & 0xc0) !== 0x80 ||
+ (buf[i + 3] & 0xc0) !== 0x80 ||
+ (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong
+ (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||
+ buf[i] > 0xf4 // > U+10FFFF
+ ) {
+ return false;
+ }
+
+ i += 4;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Determines whether a value is a `Blob`.
+ *
+ * @param {*} value The value to be tested
+ * @return {Boolean} `true` if `value` is a `Blob`, else `false`
+ * @private
+ */
+function isBlob(value) {
+ return (
+ hasBlob &&
+ typeof value === 'object' &&
+ typeof value.arrayBuffer === 'function' &&
+ typeof value.type === 'string' &&
+ typeof value.stream === 'function' &&
+ (value[Symbol.toStringTag] === 'Blob' ||
+ value[Symbol.toStringTag] === 'File')
+ );
+}
+
+module.exports = {
+ isBlob,
+ isValidStatusCode,
+ isValidUTF8: _isValidUTF8,
+ tokenChars
+};
+
+if (isUtf8) {
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
+ };
+} /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
+ try {
+ const isValidUTF8 = require('utf-8-validate');
+
+ module.exports.isValidUTF8 = function (buf) {
+ return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
+ };
+ } catch (e) {
+ // Continue regardless of the error.
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket-server.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket-server.js"
new file mode 100644
index 0000000..67b52ff
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket-server.js"
@@ -0,0 +1,540 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$", "caughtErrors": "none" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const http = require('http');
+const { Duplex } = require('stream');
+const { createHash } = require('crypto');
+
+const extension = require('./extension');
+const PerMessageDeflate = require('./permessage-deflate');
+const subprotocol = require('./subprotocol');
+const WebSocket = require('./websocket');
+const { GUID, kWebSocket } = require('./constants');
+
+const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
+
+const RUNNING = 0;
+const CLOSING = 1;
+const CLOSED = 2;
+
+/**
+ * Class representing a WebSocket server.
+ *
+ * @extends EventEmitter
+ */
+class WebSocketServer extends EventEmitter {
+ /**
+ * Create a `WebSocketServer` instance.
+ *
+ * @param {Object} options Configuration options
+ * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Number} [options.backlog=511] The maximum length of the queue of
+ * pending connections
+ * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
+ * track clients
+ * @param {Function} [options.handleProtocols] A hook to handle protocols
+ * @param {String} [options.host] The hostname where to bind the server
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Boolean} [options.noServer=false] Enable no server mode
+ * @param {String} [options.path] Accept only connections matching this path
+ * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.port] The port where to bind the server
+ * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
+ * server to use
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @param {Function} [options.verifyClient] A hook to reject connections
+ * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
+ * class to use. It must be the `WebSocket` class or class that extends it
+ * @param {Function} [callback] A listener for the `listening` event
+ */
+ constructor(options, callback) {
+ super();
+
+ options = {
+ allowSynchronousEvents: true,
+ autoPong: true,
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: false,
+ handleProtocols: null,
+ clientTracking: true,
+ verifyClient: null,
+ noServer: false,
+ backlog: null, // use default (511 as implemented in net.js)
+ server: null,
+ host: null,
+ path: null,
+ port: null,
+ WebSocket,
+ ...options
+ };
+
+ if (
+ (options.port == null && !options.server && !options.noServer) ||
+ (options.port != null && (options.server || options.noServer)) ||
+ (options.server && options.noServer)
+ ) {
+ throw new TypeError(
+ 'One and only one of the "port", "server", or "noServer" options ' +
+ 'must be specified'
+ );
+ }
+
+ if (options.port != null) {
+ this._server = http.createServer((req, res) => {
+ const body = http.STATUS_CODES[426];
+
+ res.writeHead(426, {
+ 'Content-Length': body.length,
+ 'Content-Type': 'text/plain'
+ });
+ res.end(body);
+ });
+ this._server.listen(
+ options.port,
+ options.host,
+ options.backlog,
+ callback
+ );
+ } else if (options.server) {
+ this._server = options.server;
+ }
+
+ if (this._server) {
+ const emitConnection = this.emit.bind(this, 'connection');
+
+ this._removeListeners = addListeners(this._server, {
+ listening: this.emit.bind(this, 'listening'),
+ error: this.emit.bind(this, 'error'),
+ upgrade: (req, socket, head) => {
+ this.handleUpgrade(req, socket, head, emitConnection);
+ }
+ });
+ }
+
+ if (options.perMessageDeflate === true) options.perMessageDeflate = {};
+ if (options.clientTracking) {
+ this.clients = new Set();
+ this._shouldEmitClose = false;
+ }
+
+ this.options = options;
+ this._state = RUNNING;
+ }
+
+ /**
+ * Returns the bound address, the address family name, and port of the server
+ * as reported by the operating system if listening on an IP socket.
+ * If the server is listening on a pipe or UNIX domain socket, the name is
+ * returned as a string.
+ *
+ * @return {(Object|String|null)} The address of the server
+ * @public
+ */
+ address() {
+ if (this.options.noServer) {
+ throw new Error('The server is operating in "noServer" mode');
+ }
+
+ if (!this._server) return null;
+ return this._server.address();
+ }
+
+ /**
+ * Stop the server from accepting new connections and emit the `'close'` event
+ * when all existing connections are closed.
+ *
+ * @param {Function} [cb] A one-time listener for the `'close'` event
+ * @public
+ */
+ close(cb) {
+ if (this._state === CLOSED) {
+ if (cb) {
+ this.once('close', () => {
+ cb(new Error('The server is not running'));
+ });
+ }
+
+ process.nextTick(emitClose, this);
+ return;
+ }
+
+ if (cb) this.once('close', cb);
+
+ if (this._state === CLOSING) return;
+ this._state = CLOSING;
+
+ if (this.options.noServer || this.options.server) {
+ if (this._server) {
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+ }
+
+ if (this.clients) {
+ if (!this.clients.size) {
+ process.nextTick(emitClose, this);
+ } else {
+ this._shouldEmitClose = true;
+ }
+ } else {
+ process.nextTick(emitClose, this);
+ }
+ } else {
+ const server = this._server;
+
+ this._removeListeners();
+ this._removeListeners = this._server = null;
+
+ //
+ // The HTTP/S server was created internally. Close it, and rely on its
+ // `'close'` event.
+ //
+ server.close(() => {
+ emitClose(this);
+ });
+ }
+ }
+
+ /**
+ * See if a given request should be handled by this server instance.
+ *
+ * @param {http.IncomingMessage} req Request object to inspect
+ * @return {Boolean} `true` if the request is valid, else `false`
+ * @public
+ */
+ shouldHandle(req) {
+ if (this.options.path) {
+ const index = req.url.indexOf('?');
+ const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
+
+ if (pathname !== this.options.path) return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Handle a HTTP Upgrade request.
+ *
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @public
+ */
+ handleUpgrade(req, socket, head, cb) {
+ socket.on('error', socketOnError);
+
+ const key = req.headers['sec-websocket-key'];
+ const upgrade = req.headers.upgrade;
+ const version = +req.headers['sec-websocket-version'];
+
+ if (req.method !== 'GET') {
+ const message = 'Invalid HTTP method';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
+ return;
+ }
+
+ if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {
+ const message = 'Invalid Upgrade header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (key === undefined || !keyRegex.test(key)) {
+ const message = 'Missing or invalid Sec-WebSocket-Key header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (version !== 8 && version !== 13) {
+ const message = 'Missing or invalid Sec-WebSocket-Version header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+
+ if (!this.shouldHandle(req)) {
+ abortHandshake(socket, 400);
+ return;
+ }
+
+ const secWebSocketProtocol = req.headers['sec-websocket-protocol'];
+ let protocols = new Set();
+
+ if (secWebSocketProtocol !== undefined) {
+ try {
+ protocols = subprotocol.parse(secWebSocketProtocol);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Protocol header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ const secWebSocketExtensions = req.headers['sec-websocket-extensions'];
+ const extensions = {};
+
+ if (
+ this.options.perMessageDeflate &&
+ secWebSocketExtensions !== undefined
+ ) {
+ const perMessageDeflate = new PerMessageDeflate(
+ this.options.perMessageDeflate,
+ true,
+ this.options.maxPayload
+ );
+
+ try {
+ const offers = extension.parse(secWebSocketExtensions);
+
+ if (offers[PerMessageDeflate.extensionName]) {
+ perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
+ extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
+ }
+ } catch (err) {
+ const message =
+ 'Invalid or unacceptable Sec-WebSocket-Extensions header';
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
+ return;
+ }
+ }
+
+ //
+ // Optionally call external client verification handler.
+ //
+ if (this.options.verifyClient) {
+ const info = {
+ origin:
+ req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
+ secure: !!(req.socket.authorized || req.socket.encrypted),
+ req
+ };
+
+ if (this.options.verifyClient.length === 2) {
+ this.options.verifyClient(info, (verified, code, message, headers) => {
+ if (!verified) {
+ return abortHandshake(socket, code || 401, message, headers);
+ }
+
+ this.completeUpgrade(
+ extensions,
+ key,
+ protocols,
+ req,
+ socket,
+ head,
+ cb
+ );
+ });
+ return;
+ }
+
+ if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
+ }
+
+ this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
+ }
+
+ /**
+ * Upgrade the connection to WebSocket.
+ *
+ * @param {Object} extensions The accepted extensions
+ * @param {String} key The value of the `Sec-WebSocket-Key` header
+ * @param {Set} protocols The subprotocols
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Function} cb Callback
+ * @throws {Error} If called more than once with the same socket
+ * @private
+ */
+ completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
+ //
+ // Destroy the socket if the client has already sent a FIN packet.
+ //
+ if (!socket.readable || !socket.writable) return socket.destroy();
+
+ if (socket[kWebSocket]) {
+ throw new Error(
+ 'server.handleUpgrade() was called more than once with the same ' +
+ 'socket, possibly due to a misconfiguration'
+ );
+ }
+
+ if (this._state > RUNNING) return abortHandshake(socket, 503);
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ const headers = [
+ 'HTTP/1.1 101 Switching Protocols',
+ 'Upgrade: websocket',
+ 'Connection: Upgrade',
+ `Sec-WebSocket-Accept: ${digest}`
+ ];
+
+ const ws = new this.options.WebSocket(null, undefined, this.options);
+
+ if (protocols.size) {
+ //
+ // Optionally call external protocol selection handler.
+ //
+ const protocol = this.options.handleProtocols
+ ? this.options.handleProtocols(protocols, req)
+ : protocols.values().next().value;
+
+ if (protocol) {
+ headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
+ ws._protocol = protocol;
+ }
+ }
+
+ if (extensions[PerMessageDeflate.extensionName]) {
+ const params = extensions[PerMessageDeflate.extensionName].params;
+ const value = extension.format({
+ [PerMessageDeflate.extensionName]: [params]
+ });
+ headers.push(`Sec-WebSocket-Extensions: ${value}`);
+ ws._extensions = extensions;
+ }
+
+ //
+ // Allow external modification/inspection of handshake headers.
+ //
+ this.emit('headers', headers, req);
+
+ socket.write(headers.concat('\r\n').join('\r\n'));
+ socket.removeListener('error', socketOnError);
+
+ ws.setSocket(socket, head, {
+ allowSynchronousEvents: this.options.allowSynchronousEvents,
+ maxPayload: this.options.maxPayload,
+ skipUTF8Validation: this.options.skipUTF8Validation
+ });
+
+ if (this.clients) {
+ this.clients.add(ws);
+ ws.on('close', () => {
+ this.clients.delete(ws);
+
+ if (this._shouldEmitClose && !this.clients.size) {
+ process.nextTick(emitClose, this);
+ }
+ });
+ }
+
+ cb(ws, req);
+ }
+}
+
+module.exports = WebSocketServer;
+
+/**
+ * Add event listeners on an `EventEmitter` using a map of
+ * pairs.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @param {Object.} map The listeners to add
+ * @return {Function} A function that will remove the added listeners when
+ * called
+ * @private
+ */
+function addListeners(server, map) {
+ for (const event of Object.keys(map)) server.on(event, map[event]);
+
+ return function removeListeners() {
+ for (const event of Object.keys(map)) {
+ server.removeListener(event, map[event]);
+ }
+ };
+}
+
+/**
+ * Emit a `'close'` event on an `EventEmitter`.
+ *
+ * @param {EventEmitter} server The event emitter
+ * @private
+ */
+function emitClose(server) {
+ server._state = CLOSED;
+ server.emit('close');
+}
+
+/**
+ * Handle socket errors.
+ *
+ * @private
+ */
+function socketOnError() {
+ this.destroy();
+}
+
+/**
+ * Close the connection when preconditions are not fulfilled.
+ *
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} [message] The HTTP response body
+ * @param {Object} [headers] Additional HTTP response headers
+ * @private
+ */
+function abortHandshake(socket, code, message, headers) {
+ //
+ // The socket is writable unless the user destroyed or ended it before calling
+ // `server.handleUpgrade()` or in the `verifyClient` function, which is a user
+ // error. Handling this does not make much sense as the worst that can happen
+ // is that some of the data written by the user might be discarded due to the
+ // call to `socket.end()` below, which triggers an `'error'` event that in
+ // turn causes the socket to be destroyed.
+ //
+ message = message || http.STATUS_CODES[code];
+ headers = {
+ Connection: 'close',
+ 'Content-Type': 'text/html',
+ 'Content-Length': Buffer.byteLength(message),
+ ...headers
+ };
+
+ socket.once('finish', socket.destroy);
+
+ socket.end(
+ `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
+ Object.keys(headers)
+ .map((h) => `${h}: ${headers[h]}`)
+ .join('\r\n') +
+ '\r\n\r\n' +
+ message
+ );
+}
+
+/**
+ * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least
+ * one listener for it, otherwise call `abortHandshake()`.
+ *
+ * @param {WebSocketServer} server The WebSocket server
+ * @param {http.IncomingMessage} req The request object
+ * @param {Duplex} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} message The HTTP response body
+ * @private
+ */
+function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
+ if (server.listenerCount('wsClientError')) {
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
+
+ server.emit('wsClientError', err, socket, req);
+ } else {
+ abortHandshake(socket, code, message);
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket.js" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket.js"
new file mode 100644
index 0000000..7fb4029
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/lib/websocket.js"
@@ -0,0 +1,1388 @@
+/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$", "caughtErrors": "none" }] */
+
+'use strict';
+
+const EventEmitter = require('events');
+const https = require('https');
+const http = require('http');
+const net = require('net');
+const tls = require('tls');
+const { randomBytes, createHash } = require('crypto');
+const { Duplex, Readable } = require('stream');
+const { URL } = require('url');
+
+const PerMessageDeflate = require('./permessage-deflate');
+const Receiver = require('./receiver');
+const Sender = require('./sender');
+const { isBlob } = require('./validation');
+
+const {
+ BINARY_TYPES,
+ EMPTY_BUFFER,
+ GUID,
+ kForOnEventAttribute,
+ kListener,
+ kStatusCode,
+ kWebSocket,
+ NOOP
+} = require('./constants');
+const {
+ EventTarget: { addEventListener, removeEventListener }
+} = require('./event-target');
+const { format, parse } = require('./extension');
+const { toBuffer } = require('./buffer-util');
+
+const closeTimeout = 30 * 1000;
+const kAborted = Symbol('kAborted');
+const protocolVersions = [8, 13];
+const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
+const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
+
+/**
+ * Class representing a WebSocket.
+ *
+ * @extends EventEmitter
+ */
+class WebSocket extends EventEmitter {
+ /**
+ * Create a new `WebSocket`.
+ *
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {(String|String[])} [protocols] The subprotocols
+ * @param {Object} [options] Connection options
+ */
+ constructor(address, protocols, options) {
+ super();
+
+ this._binaryType = BINARY_TYPES[0];
+ this._closeCode = 1006;
+ this._closeFrameReceived = false;
+ this._closeFrameSent = false;
+ this._closeMessage = EMPTY_BUFFER;
+ this._closeTimer = null;
+ this._errorEmitted = false;
+ this._extensions = {};
+ this._paused = false;
+ this._protocol = '';
+ this._readyState = WebSocket.CONNECTING;
+ this._receiver = null;
+ this._sender = null;
+ this._socket = null;
+
+ if (address !== null) {
+ this._bufferedAmount = 0;
+ this._isServer = false;
+ this._redirects = 0;
+
+ if (protocols === undefined) {
+ protocols = [];
+ } else if (!Array.isArray(protocols)) {
+ if (typeof protocols === 'object' && protocols !== null) {
+ options = protocols;
+ protocols = [];
+ } else {
+ protocols = [protocols];
+ }
+ }
+
+ initAsClient(this, address, protocols, options);
+ } else {
+ this._autoPong = options.autoPong;
+ this._isServer = true;
+ }
+ }
+
+ /**
+ * For historical reasons, the custom "nodebuffer" type is used by the default
+ * instead of "blob".
+ *
+ * @type {String}
+ */
+ get binaryType() {
+ return this._binaryType;
+ }
+
+ set binaryType(type) {
+ if (!BINARY_TYPES.includes(type)) return;
+
+ this._binaryType = type;
+
+ //
+ // Allow to change `binaryType` on the fly.
+ //
+ if (this._receiver) this._receiver._binaryType = type;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get bufferedAmount() {
+ if (!this._socket) return this._bufferedAmount;
+
+ return this._socket._writableState.length + this._sender._bufferedBytes;
+ }
+
+ /**
+ * @type {String}
+ */
+ get extensions() {
+ return Object.keys(this._extensions).join();
+ }
+
+ /**
+ * @type {Boolean}
+ */
+ get isPaused() {
+ return this._paused;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onclose() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onerror() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onopen() {
+ return null;
+ }
+
+ /**
+ * @type {Function}
+ */
+ /* istanbul ignore next */
+ get onmessage() {
+ return null;
+ }
+
+ /**
+ * @type {String}
+ */
+ get protocol() {
+ return this._protocol;
+ }
+
+ /**
+ * @type {Number}
+ */
+ get readyState() {
+ return this._readyState;
+ }
+
+ /**
+ * @type {String}
+ */
+ get url() {
+ return this._url;
+ }
+
+ /**
+ * Set up the socket and the internal resources.
+ *
+ * @param {Duplex} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Object} options Options object
+ * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
+ * multiple times in the same tick
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.maxPayload=0] The maximum allowed message size
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+ setSocket(socket, head, options) {
+ const receiver = new Receiver({
+ allowSynchronousEvents: options.allowSynchronousEvents,
+ binaryType: this.binaryType,
+ extensions: this._extensions,
+ isServer: this._isServer,
+ maxPayload: options.maxPayload,
+ skipUTF8Validation: options.skipUTF8Validation
+ });
+
+ const sender = new Sender(socket, this._extensions, options.generateMask);
+
+ this._receiver = receiver;
+ this._sender = sender;
+ this._socket = socket;
+
+ receiver[kWebSocket] = this;
+ sender[kWebSocket] = this;
+ socket[kWebSocket] = this;
+
+ receiver.on('conclude', receiverOnConclude);
+ receiver.on('drain', receiverOnDrain);
+ receiver.on('error', receiverOnError);
+ receiver.on('message', receiverOnMessage);
+ receiver.on('ping', receiverOnPing);
+ receiver.on('pong', receiverOnPong);
+
+ sender.onerror = senderOnError;
+
+ //
+ // These methods may not be available if `socket` is just a `Duplex`.
+ //
+ if (socket.setTimeout) socket.setTimeout(0);
+ if (socket.setNoDelay) socket.setNoDelay();
+
+ if (head.length > 0) socket.unshift(head);
+
+ socket.on('close', socketOnClose);
+ socket.on('data', socketOnData);
+ socket.on('end', socketOnEnd);
+ socket.on('error', socketOnError);
+
+ this._readyState = WebSocket.OPEN;
+ this.emit('open');
+ }
+
+ /**
+ * Emit the `'close'` event.
+ *
+ * @private
+ */
+ emitClose() {
+ if (!this._socket) {
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ return;
+ }
+
+ if (this._extensions[PerMessageDeflate.extensionName]) {
+ this._extensions[PerMessageDeflate.extensionName].cleanup();
+ }
+
+ this._receiver.removeAllListeners();
+ this._readyState = WebSocket.CLOSED;
+ this.emit('close', this._closeCode, this._closeMessage);
+ }
+
+ /**
+ * Start a closing handshake.
+ *
+ * +----------+ +-----------+ +----------+
+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
+ * | +----------+ +-----------+ +----------+ |
+ * +----------+ +-----------+ |
+ * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING
+ * +----------+ +-----------+ |
+ * | | | +---+ |
+ * +------------------------+-->|fin| - - - -
+ * | +---+ | +---+
+ * - - - - -|fin|<---------------------+
+ * +---+
+ *
+ * @param {Number} [code] Status code explaining why the connection is closing
+ * @param {(String|Buffer)} [data] The reason why the connection is
+ * closing
+ * @public
+ */
+ close(code, data) {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this.readyState === WebSocket.CLOSING) {
+ if (
+ this._closeFrameSent &&
+ (this._closeFrameReceived || this._receiver._writableState.errorEmitted)
+ ) {
+ this._socket.end();
+ }
+
+ return;
+ }
+
+ this._readyState = WebSocket.CLOSING;
+ this._sender.close(code, data, !this._isServer, (err) => {
+ //
+ // This error is handled by the `'error'` listener on the socket. We only
+ // want to know if the close frame has been sent here.
+ //
+ if (err) return;
+
+ this._closeFrameSent = true;
+
+ if (
+ this._closeFrameReceived ||
+ this._receiver._writableState.errorEmitted
+ ) {
+ this._socket.end();
+ }
+ });
+
+ setCloseTimer(this);
+ }
+
+ /**
+ * Pause the socket.
+ *
+ * @public
+ */
+ pause() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = true;
+ this._socket.pause();
+ }
+
+ /**
+ * Send a ping.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the ping is sent
+ * @public
+ */
+ ping(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.ping(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Send a pong.
+ *
+ * @param {*} [data] The data to send
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when the pong is sent
+ * @public
+ */
+ pong(data, mask, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof data === 'function') {
+ cb = data;
+ data = mask = undefined;
+ } else if (typeof mask === 'function') {
+ cb = mask;
+ mask = undefined;
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ if (mask === undefined) mask = !this._isServer;
+ this._sender.pong(data || EMPTY_BUFFER, mask, cb);
+ }
+
+ /**
+ * Resume the socket.
+ *
+ * @public
+ */
+ resume() {
+ if (
+ this.readyState === WebSocket.CONNECTING ||
+ this.readyState === WebSocket.CLOSED
+ ) {
+ return;
+ }
+
+ this._paused = false;
+ if (!this._receiver._writableState.needDrain) this._socket.resume();
+ }
+
+ /**
+ * Send a data message.
+ *
+ * @param {*} data The message to send
+ * @param {Object} [options] Options object
+ * @param {Boolean} [options.binary] Specifies whether `data` is binary or
+ * text
+ * @param {Boolean} [options.compress] Specifies whether or not to compress
+ * `data`
+ * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
+ * last one
+ * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
+ * @param {Function} [cb] Callback which is executed when data is written out
+ * @public
+ */
+ send(data, options, cb) {
+ if (this.readyState === WebSocket.CONNECTING) {
+ throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
+ }
+
+ if (typeof options === 'function') {
+ cb = options;
+ options = {};
+ }
+
+ if (typeof data === 'number') data = data.toString();
+
+ if (this.readyState !== WebSocket.OPEN) {
+ sendAfterClose(this, data, cb);
+ return;
+ }
+
+ const opts = {
+ binary: typeof data !== 'string',
+ mask: !this._isServer,
+ compress: true,
+ fin: true,
+ ...options
+ };
+
+ if (!this._extensions[PerMessageDeflate.extensionName]) {
+ opts.compress = false;
+ }
+
+ this._sender.send(data || EMPTY_BUFFER, opts, cb);
+ }
+
+ /**
+ * Forcibly close the connection.
+ *
+ * @public
+ */
+ terminate() {
+ if (this.readyState === WebSocket.CLOSED) return;
+ if (this.readyState === WebSocket.CONNECTING) {
+ const msg = 'WebSocket was closed before the connection was established';
+ abortHandshake(this, this._req, msg);
+ return;
+ }
+
+ if (this._socket) {
+ this._readyState = WebSocket.CLOSING;
+ this._socket.destroy();
+ }
+ }
+}
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} CONNECTING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CONNECTING', {
+ enumerable: true,
+ value: readyStates.indexOf('CONNECTING')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} OPEN
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'OPEN', {
+ enumerable: true,
+ value: readyStates.indexOf('OPEN')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSING
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSING', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSING')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket
+ */
+Object.defineProperty(WebSocket, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+/**
+ * @constant {Number} CLOSED
+ * @memberof WebSocket.prototype
+ */
+Object.defineProperty(WebSocket.prototype, 'CLOSED', {
+ enumerable: true,
+ value: readyStates.indexOf('CLOSED')
+});
+
+[
+ 'binaryType',
+ 'bufferedAmount',
+ 'extensions',
+ 'isPaused',
+ 'protocol',
+ 'readyState',
+ 'url'
+].forEach((property) => {
+ Object.defineProperty(WebSocket.prototype, property, { enumerable: true });
+});
+
+//
+// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.
+// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
+//
+['open', 'error', 'close', 'message'].forEach((method) => {
+ Object.defineProperty(WebSocket.prototype, `on${method}`, {
+ enumerable: true,
+ get() {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) return listener[kListener];
+ }
+
+ return null;
+ },
+ set(handler) {
+ for (const listener of this.listeners(method)) {
+ if (listener[kForOnEventAttribute]) {
+ this.removeListener(method, listener);
+ break;
+ }
+ }
+
+ if (typeof handler !== 'function') return;
+
+ this.addEventListener(method, handler, {
+ [kForOnEventAttribute]: true
+ });
+ }
+ });
+});
+
+WebSocket.prototype.addEventListener = addEventListener;
+WebSocket.prototype.removeEventListener = removeEventListener;
+
+module.exports = WebSocket;
+
+/**
+ * Initialize a WebSocket client.
+ *
+ * @param {WebSocket} websocket The client to initialize
+ * @param {(String|URL)} address The URL to which to connect
+ * @param {Array} protocols The subprotocols
+ * @param {Object} [options] Connection options
+ * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether any
+ * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple
+ * times in the same tick
+ * @param {Boolean} [options.autoPong=true] Specifies whether or not to
+ * automatically send a pong in response to a ping
+ * @param {Function} [options.finishRequest] A function which can be used to
+ * customize the headers of each http request before it is sent
+ * @param {Boolean} [options.followRedirects=false] Whether or not to follow
+ * redirects
+ * @param {Function} [options.generateMask] The function used to generate the
+ * masking key
+ * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
+ * handshake request
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
+ * size
+ * @param {Number} [options.maxRedirects=10] The maximum number of redirects
+ * allowed
+ * @param {String} [options.origin] Value of the `Origin` or
+ * `Sec-WebSocket-Origin` header
+ * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
+ * permessage-deflate
+ * @param {Number} [options.protocolVersion=13] Value of the
+ * `Sec-WebSocket-Version` header
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
+ * not to skip UTF-8 validation for text and close messages
+ * @private
+ */
+function initAsClient(websocket, address, protocols, options) {
+ const opts = {
+ allowSynchronousEvents: true,
+ autoPong: true,
+ protocolVersion: protocolVersions[1],
+ maxPayload: 100 * 1024 * 1024,
+ skipUTF8Validation: false,
+ perMessageDeflate: true,
+ followRedirects: false,
+ maxRedirects: 10,
+ ...options,
+ socketPath: undefined,
+ hostname: undefined,
+ protocol: undefined,
+ timeout: undefined,
+ method: 'GET',
+ host: undefined,
+ path: undefined,
+ port: undefined
+ };
+
+ websocket._autoPong = opts.autoPong;
+
+ if (!protocolVersions.includes(opts.protocolVersion)) {
+ throw new RangeError(
+ `Unsupported protocol version: ${opts.protocolVersion} ` +
+ `(supported versions: ${protocolVersions.join(', ')})`
+ );
+ }
+
+ let parsedUrl;
+
+ if (address instanceof URL) {
+ parsedUrl = address;
+ } else {
+ try {
+ parsedUrl = new URL(address);
+ } catch (e) {
+ throw new SyntaxError(`Invalid URL: ${address}`);
+ }
+ }
+
+ if (parsedUrl.protocol === 'http:') {
+ parsedUrl.protocol = 'ws:';
+ } else if (parsedUrl.protocol === 'https:') {
+ parsedUrl.protocol = 'wss:';
+ }
+
+ websocket._url = parsedUrl.href;
+
+ const isSecure = parsedUrl.protocol === 'wss:';
+ const isIpcUrl = parsedUrl.protocol === 'ws+unix:';
+ let invalidUrlMessage;
+
+ if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {
+ invalidUrlMessage =
+ 'The URL\'s protocol must be one of "ws:", "wss:", ' +
+ '"http:", "https", or "ws+unix:"';
+ } else if (isIpcUrl && !parsedUrl.pathname) {
+ invalidUrlMessage = "The URL's pathname is empty";
+ } else if (parsedUrl.hash) {
+ invalidUrlMessage = 'The URL contains a fragment identifier';
+ }
+
+ if (invalidUrlMessage) {
+ const err = new SyntaxError(invalidUrlMessage);
+
+ if (websocket._redirects === 0) {
+ throw err;
+ } else {
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+ }
+
+ const defaultPort = isSecure ? 443 : 80;
+ const key = randomBytes(16).toString('base64');
+ const request = isSecure ? https.request : http.request;
+ const protocolSet = new Set();
+ let perMessageDeflate;
+
+ opts.createConnection =
+ opts.createConnection || (isSecure ? tlsConnect : netConnect);
+ opts.defaultPort = opts.defaultPort || defaultPort;
+ opts.port = parsedUrl.port || defaultPort;
+ opts.host = parsedUrl.hostname.startsWith('[')
+ ? parsedUrl.hostname.slice(1, -1)
+ : parsedUrl.hostname;
+ opts.headers = {
+ ...opts.headers,
+ 'Sec-WebSocket-Version': opts.protocolVersion,
+ 'Sec-WebSocket-Key': key,
+ Connection: 'Upgrade',
+ Upgrade: 'websocket'
+ };
+ opts.path = parsedUrl.pathname + parsedUrl.search;
+ opts.timeout = opts.handshakeTimeout;
+
+ if (opts.perMessageDeflate) {
+ perMessageDeflate = new PerMessageDeflate(
+ opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
+ false,
+ opts.maxPayload
+ );
+ opts.headers['Sec-WebSocket-Extensions'] = format({
+ [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
+ });
+ }
+ if (protocols.length) {
+ for (const protocol of protocols) {
+ if (
+ typeof protocol !== 'string' ||
+ !subprotocolRegex.test(protocol) ||
+ protocolSet.has(protocol)
+ ) {
+ throw new SyntaxError(
+ 'An invalid or duplicated subprotocol was specified'
+ );
+ }
+
+ protocolSet.add(protocol);
+ }
+
+ opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');
+ }
+ if (opts.origin) {
+ if (opts.protocolVersion < 13) {
+ opts.headers['Sec-WebSocket-Origin'] = opts.origin;
+ } else {
+ opts.headers.Origin = opts.origin;
+ }
+ }
+ if (parsedUrl.username || parsedUrl.password) {
+ opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
+ }
+
+ if (isIpcUrl) {
+ const parts = opts.path.split(':');
+
+ opts.socketPath = parts[0];
+ opts.path = parts[1];
+ }
+
+ let req;
+
+ if (opts.followRedirects) {
+ if (websocket._redirects === 0) {
+ websocket._originalIpc = isIpcUrl;
+ websocket._originalSecure = isSecure;
+ websocket._originalHostOrSocketPath = isIpcUrl
+ ? opts.socketPath
+ : parsedUrl.host;
+
+ const headers = options && options.headers;
+
+ //
+ // Shallow copy the user provided options so that headers can be changed
+ // without mutating the original object.
+ //
+ options = { ...options, headers: {} };
+
+ if (headers) {
+ for (const [key, value] of Object.entries(headers)) {
+ options.headers[key.toLowerCase()] = value;
+ }
+ }
+ } else if (websocket.listenerCount('redirect') === 0) {
+ const isSameHost = isIpcUrl
+ ? websocket._originalIpc
+ ? opts.socketPath === websocket._originalHostOrSocketPath
+ : false
+ : websocket._originalIpc
+ ? false
+ : parsedUrl.host === websocket._originalHostOrSocketPath;
+
+ if (!isSameHost || (websocket._originalSecure && !isSecure)) {
+ //
+ // Match curl 7.77.0 behavior and drop the following headers. These
+ // headers are also dropped when following a redirect to a subdomain.
+ //
+ delete opts.headers.authorization;
+ delete opts.headers.cookie;
+
+ if (!isSameHost) delete opts.headers.host;
+
+ opts.auth = undefined;
+ }
+ }
+
+ //
+ // Match curl 7.77.0 behavior and make the first `Authorization` header win.
+ // If the `Authorization` header is set, then there is nothing to do as it
+ // will take precedence.
+ //
+ if (opts.auth && !options.headers.authorization) {
+ options.headers.authorization =
+ 'Basic ' + Buffer.from(opts.auth).toString('base64');
+ }
+
+ req = websocket._req = request(opts);
+
+ if (websocket._redirects) {
+ //
+ // Unlike what is done for the `'upgrade'` event, no early exit is
+ // triggered here if the user calls `websocket.close()` or
+ // `websocket.terminate()` from a listener of the `'redirect'` event. This
+ // is because the user can also call `request.destroy()` with an error
+ // before calling `websocket.close()` or `websocket.terminate()` and this
+ // would result in an error being emitted on the `request` object with no
+ // `'error'` event listeners attached.
+ //
+ websocket.emit('redirect', websocket.url, req);
+ }
+ } else {
+ req = websocket._req = request(opts);
+ }
+
+ if (opts.timeout) {
+ req.on('timeout', () => {
+ abortHandshake(websocket, req, 'Opening handshake has timed out');
+ });
+ }
+
+ req.on('error', (err) => {
+ if (req === null || req[kAborted]) return;
+
+ req = websocket._req = null;
+ emitErrorAndClose(websocket, err);
+ });
+
+ req.on('response', (res) => {
+ const location = res.headers.location;
+ const statusCode = res.statusCode;
+
+ if (
+ location &&
+ opts.followRedirects &&
+ statusCode >= 300 &&
+ statusCode < 400
+ ) {
+ if (++websocket._redirects > opts.maxRedirects) {
+ abortHandshake(websocket, req, 'Maximum redirects exceeded');
+ return;
+ }
+
+ req.abort();
+
+ let addr;
+
+ try {
+ addr = new URL(location, address);
+ } catch (e) {
+ const err = new SyntaxError(`Invalid URL: ${location}`);
+ emitErrorAndClose(websocket, err);
+ return;
+ }
+
+ initAsClient(websocket, addr, protocols, options);
+ } else if (!websocket.emit('unexpected-response', req, res)) {
+ abortHandshake(
+ websocket,
+ req,
+ `Unexpected server response: ${res.statusCode}`
+ );
+ }
+ });
+
+ req.on('upgrade', (res, socket, head) => {
+ websocket.emit('upgrade', res);
+
+ //
+ // The user may have closed the connection from a listener of the
+ // `'upgrade'` event.
+ //
+ if (websocket.readyState !== WebSocket.CONNECTING) return;
+
+ req = websocket._req = null;
+
+ const upgrade = res.headers.upgrade;
+
+ if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {
+ abortHandshake(websocket, socket, 'Invalid Upgrade header');
+ return;
+ }
+
+ const digest = createHash('sha1')
+ .update(key + GUID)
+ .digest('base64');
+
+ if (res.headers['sec-websocket-accept'] !== digest) {
+ abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');
+ return;
+ }
+
+ const serverProt = res.headers['sec-websocket-protocol'];
+ let protError;
+
+ if (serverProt !== undefined) {
+ if (!protocolSet.size) {
+ protError = 'Server sent a subprotocol but none was requested';
+ } else if (!protocolSet.has(serverProt)) {
+ protError = 'Server sent an invalid subprotocol';
+ }
+ } else if (protocolSet.size) {
+ protError = 'Server sent no subprotocol';
+ }
+
+ if (protError) {
+ abortHandshake(websocket, socket, protError);
+ return;
+ }
+
+ if (serverProt) websocket._protocol = serverProt;
+
+ const secWebSocketExtensions = res.headers['sec-websocket-extensions'];
+
+ if (secWebSocketExtensions !== undefined) {
+ if (!perMessageDeflate) {
+ const message =
+ 'Server sent a Sec-WebSocket-Extensions header but no extension ' +
+ 'was requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ let extensions;
+
+ try {
+ extensions = parse(secWebSocketExtensions);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ const extensionNames = Object.keys(extensions);
+
+ if (
+ extensionNames.length !== 1 ||
+ extensionNames[0] !== PerMessageDeflate.extensionName
+ ) {
+ const message = 'Server indicated an extension that was not requested';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ try {
+ perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
+ } catch (err) {
+ const message = 'Invalid Sec-WebSocket-Extensions header';
+ abortHandshake(websocket, socket, message);
+ return;
+ }
+
+ websocket._extensions[PerMessageDeflate.extensionName] =
+ perMessageDeflate;
+ }
+
+ websocket.setSocket(socket, head, {
+ allowSynchronousEvents: opts.allowSynchronousEvents,
+ generateMask: opts.generateMask,
+ maxPayload: opts.maxPayload,
+ skipUTF8Validation: opts.skipUTF8Validation
+ });
+ });
+
+ if (opts.finishRequest) {
+ opts.finishRequest(req, websocket);
+ } else {
+ req.end();
+ }
+}
+
+/**
+ * Emit the `'error'` and `'close'` events.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {Error} The error to emit
+ * @private
+ */
+function emitErrorAndClose(websocket, err) {
+ websocket._readyState = WebSocket.CLOSING;
+ //
+ // The following assignment is practically useless and is done only for
+ // consistency.
+ //
+ websocket._errorEmitted = true;
+ websocket.emit('error', err);
+ websocket.emitClose();
+}
+
+/**
+ * Create a `net.Socket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {net.Socket} The newly created socket used to start the connection
+ * @private
+ */
+function netConnect(options) {
+ options.path = options.socketPath;
+ return net.connect(options);
+}
+
+/**
+ * Create a `tls.TLSSocket` and initiate a connection.
+ *
+ * @param {Object} options Connection options
+ * @return {tls.TLSSocket} The newly created socket used to start the connection
+ * @private
+ */
+function tlsConnect(options) {
+ options.path = undefined;
+
+ if (!options.servername && options.servername !== '') {
+ options.servername = net.isIP(options.host) ? '' : options.host;
+ }
+
+ return tls.connect(options);
+}
+
+/**
+ * Abort the handshake and emit an error.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to
+ * abort or the socket to destroy
+ * @param {String} message The error message
+ * @private
+ */
+function abortHandshake(websocket, stream, message) {
+ websocket._readyState = WebSocket.CLOSING;
+
+ const err = new Error(message);
+ Error.captureStackTrace(err, abortHandshake);
+
+ if (stream.setHeader) {
+ stream[kAborted] = true;
+ stream.abort();
+
+ if (stream.socket && !stream.socket.destroyed) {
+ //
+ // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
+ // called after the request completed. See
+ // https://github.com/websockets/ws/issues/1869.
+ //
+ stream.socket.destroy();
+ }
+
+ process.nextTick(emitErrorAndClose, websocket, err);
+ } else {
+ stream.destroy(err);
+ stream.once('error', websocket.emit.bind(websocket, 'error'));
+ stream.once('close', websocket.emitClose.bind(websocket));
+ }
+}
+
+/**
+ * Handle cases where the `ping()`, `pong()`, or `send()` methods are called
+ * when the `readyState` attribute is `CLOSING` or `CLOSED`.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @param {*} [data] The data to send
+ * @param {Function} [cb] Callback
+ * @private
+ */
+function sendAfterClose(websocket, data, cb) {
+ if (data) {
+ const length = isBlob(data) ? data.size : toBuffer(data).length;
+
+ //
+ // The `_bufferedAmount` property is used only when the peer is a client and
+ // the opening handshake fails. Under these circumstances, in fact, the
+ // `setSocket()` method is not called, so the `_socket` and `_sender`
+ // properties are set to `null`.
+ //
+ if (websocket._socket) websocket._sender._bufferedBytes += length;
+ else websocket._bufferedAmount += length;
+ }
+
+ if (cb) {
+ const err = new Error(
+ `WebSocket is not open: readyState ${websocket.readyState} ` +
+ `(${readyStates[websocket.readyState]})`
+ );
+ process.nextTick(cb, err);
+ }
+}
+
+/**
+ * The listener of the `Receiver` `'conclude'` event.
+ *
+ * @param {Number} code The status code
+ * @param {Buffer} reason The reason for closing
+ * @private
+ */
+function receiverOnConclude(code, reason) {
+ const websocket = this[kWebSocket];
+
+ websocket._closeFrameReceived = true;
+ websocket._closeMessage = reason;
+ websocket._closeCode = code;
+
+ if (websocket._socket[kWebSocket] === undefined) return;
+
+ websocket._socket.removeListener('data', socketOnData);
+ process.nextTick(resume, websocket._socket);
+
+ if (code === 1005) websocket.close();
+ else websocket.close(code, reason);
+}
+
+/**
+ * The listener of the `Receiver` `'drain'` event.
+ *
+ * @private
+ */
+function receiverOnDrain() {
+ const websocket = this[kWebSocket];
+
+ if (!websocket.isPaused) websocket._socket.resume();
+}
+
+/**
+ * The listener of the `Receiver` `'error'` event.
+ *
+ * @param {(RangeError|Error)} err The emitted error
+ * @private
+ */
+function receiverOnError(err) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._socket[kWebSocket] !== undefined) {
+ websocket._socket.removeListener('data', socketOnData);
+
+ //
+ // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See
+ // https://github.com/websockets/ws/issues/1940.
+ //
+ process.nextTick(resume, websocket._socket);
+
+ websocket.close(err[kStatusCode]);
+ }
+
+ if (!websocket._errorEmitted) {
+ websocket._errorEmitted = true;
+ websocket.emit('error', err);
+ }
+}
+
+/**
+ * The listener of the `Receiver` `'finish'` event.
+ *
+ * @private
+ */
+function receiverOnFinish() {
+ this[kWebSocket].emitClose();
+}
+
+/**
+ * The listener of the `Receiver` `'message'` event.
+ *
+ * @param {Buffer|ArrayBuffer|Buffer[])} data The message
+ * @param {Boolean} isBinary Specifies whether the message is binary or not
+ * @private
+ */
+function receiverOnMessage(data, isBinary) {
+ this[kWebSocket].emit('message', data, isBinary);
+}
+
+/**
+ * The listener of the `Receiver` `'ping'` event.
+ *
+ * @param {Buffer} data The data included in the ping frame
+ * @private
+ */
+function receiverOnPing(data) {
+ const websocket = this[kWebSocket];
+
+ if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
+ websocket.emit('ping', data);
+}
+
+/**
+ * The listener of the `Receiver` `'pong'` event.
+ *
+ * @param {Buffer} data The data included in the pong frame
+ * @private
+ */
+function receiverOnPong(data) {
+ this[kWebSocket].emit('pong', data);
+}
+
+/**
+ * Resume a readable stream
+ *
+ * @param {Readable} stream The readable stream
+ * @private
+ */
+function resume(stream) {
+ stream.resume();
+}
+
+/**
+ * The `Sender` error event handler.
+ *
+ * @param {Error} The error
+ * @private
+ */
+function senderOnError(err) {
+ const websocket = this[kWebSocket];
+
+ if (websocket.readyState === WebSocket.CLOSED) return;
+ if (websocket.readyState === WebSocket.OPEN) {
+ websocket._readyState = WebSocket.CLOSING;
+ setCloseTimer(websocket);
+ }
+
+ //
+ // `socket.end()` is used instead of `socket.destroy()` to allow the other
+ // peer to finish sending queued data. There is no need to set a timer here
+ // because `CLOSING` means that it is already set or not needed.
+ //
+ this._socket.end();
+
+ if (!websocket._errorEmitted) {
+ websocket._errorEmitted = true;
+ websocket.emit('error', err);
+ }
+}
+
+/**
+ * Set a timer to destroy the underlying raw socket of a WebSocket.
+ *
+ * @param {WebSocket} websocket The WebSocket instance
+ * @private
+ */
+function setCloseTimer(websocket) {
+ websocket._closeTimer = setTimeout(
+ websocket._socket.destroy.bind(websocket._socket),
+ closeTimeout
+ );
+}
+
+/**
+ * The listener of the socket `'close'` event.
+ *
+ * @private
+ */
+function socketOnClose() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('close', socketOnClose);
+ this.removeListener('data', socketOnData);
+ this.removeListener('end', socketOnEnd);
+
+ websocket._readyState = WebSocket.CLOSING;
+
+ let chunk;
+
+ //
+ // The close frame might not have been received or the `'end'` event emitted,
+ // for example, if the socket was destroyed due to an error. Ensure that the
+ // `receiver` stream is closed after writing any remaining buffered data to
+ // it. If the readable side of the socket is in flowing mode then there is no
+ // buffered data as everything has been already written and `readable.read()`
+ // will return `null`. If instead, the socket is paused, any possible buffered
+ // data will be read as a single chunk.
+ //
+ if (
+ !this._readableState.endEmitted &&
+ !websocket._closeFrameReceived &&
+ !websocket._receiver._writableState.errorEmitted &&
+ (chunk = websocket._socket.read()) !== null
+ ) {
+ websocket._receiver.write(chunk);
+ }
+
+ websocket._receiver.end();
+
+ this[kWebSocket] = undefined;
+
+ clearTimeout(websocket._closeTimer);
+
+ if (
+ websocket._receiver._writableState.finished ||
+ websocket._receiver._writableState.errorEmitted
+ ) {
+ websocket.emitClose();
+ } else {
+ websocket._receiver.on('error', receiverOnFinish);
+ websocket._receiver.on('finish', receiverOnFinish);
+ }
+}
+
+/**
+ * The listener of the socket `'data'` event.
+ *
+ * @param {Buffer} chunk A chunk of data
+ * @private
+ */
+function socketOnData(chunk) {
+ if (!this[kWebSocket]._receiver.write(chunk)) {
+ this.pause();
+ }
+}
+
+/**
+ * The listener of the socket `'end'` event.
+ *
+ * @private
+ */
+function socketOnEnd() {
+ const websocket = this[kWebSocket];
+
+ websocket._readyState = WebSocket.CLOSING;
+ websocket._receiver.end();
+ this.end();
+}
+
+/**
+ * The listener of the socket `'error'` event.
+ *
+ * @private
+ */
+function socketOnError() {
+ const websocket = this[kWebSocket];
+
+ this.removeListener('error', socketOnError);
+ this.on('error', NOOP);
+
+ if (websocket) {
+ websocket._readyState = WebSocket.CLOSING;
+ this.destroy();
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/package.json" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/package.json"
new file mode 100644
index 0000000..4f7155d
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/package.json"
@@ -0,0 +1,69 @@
+{
+ "name": "ws",
+ "version": "8.18.0",
+ "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
+ "keywords": [
+ "HyBi",
+ "Push",
+ "RFC-6455",
+ "WebSocket",
+ "WebSockets",
+ "real-time"
+ ],
+ "homepage": "https://github.com/websockets/ws",
+ "bugs": "https://github.com/websockets/ws/issues",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/websockets/ws.git"
+ },
+ "author": "Einar Otto Stangvik (http://2x.io)",
+ "license": "MIT",
+ "main": "index.js",
+ "exports": {
+ ".": {
+ "browser": "./browser.js",
+ "import": "./wrapper.mjs",
+ "require": "./index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "browser": "browser.js",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "files": [
+ "browser.js",
+ "index.js",
+ "lib/*.js",
+ "wrapper.mjs"
+ ],
+ "scripts": {
+ "test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js",
+ "integration": "mocha --throw-deprecation test/*.integration.js",
+ "lint": "eslint . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "bufferutil": "^4.0.1",
+ "eslint": "^9.0.0",
+ "eslint-config-prettier": "^9.0.0",
+ "eslint-plugin-prettier": "^5.0.0",
+ "globals": "^15.0.0",
+ "mocha": "^8.4.0",
+ "nyc": "^15.0.0",
+ "prettier": "^3.0.0",
+ "utf-8-validate": "^6.0.0"
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/wrapper.mjs" "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/wrapper.mjs"
new file mode 100644
index 0000000..7245ad1
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/node_modules/ws/wrapper.mjs"
@@ -0,0 +1,8 @@
+import createWebSocketStream from './lib/stream.js';
+import Receiver from './lib/receiver.js';
+import Sender from './lib/sender.js';
+import WebSocket from './lib/websocket.js';
+import WebSocketServer from './lib/websocket-server.js';
+
+export { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer };
+export default WebSocket;
diff --git "a/system/websocket_test/em-ws-web\050intro\051/package-lock.json" "b/system/websocket_test/em-ws-web\050intro\051/package-lock.json"
new file mode 100644
index 0000000..46dfb9a
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/package-lock.json"
@@ -0,0 +1,44 @@
+{
+ "name": "em-ws-web",
+ "version": "1.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "em-ws-web",
+ "version": "1.0.0",
+ "license": "ISC",
+ "dependencies": {
+ "ws": "^8.18.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ },
+ "dependencies": {
+ "ws": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+ "requires": {}
+ }
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/package.json" "b/system/websocket_test/em-ws-web\050intro\051/package.json"
new file mode 100644
index 0000000..2893f3c
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/package.json"
@@ -0,0 +1,15 @@
+{
+ "name": "em-ws-web",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "ws": "^8.18.0"
+ }
+}
diff --git "a/system/websocket_test/em-ws-web\050intro\051/server/em-websocket.rb" "b/system/websocket_test/em-ws-web\050intro\051/server/em-websocket.rb"
new file mode 100755
index 0000000..8d1829a
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/server/em-websocket.rb"
@@ -0,0 +1,82 @@
+#!/usr/bin/env ruby
+
+require 'em-websocket' #websoketライブラリ
+require 'pp' #人間が読みやすいように表示してくれる
+require 'json' #json形式にしたり、直したりする
+
+PORT = 8293 #portを指定
+button_clicker = []
+clients_id_only = {} #クライエント
+
+puts "参加者が入ったら表示するよ"
+
+EM::WebSocket.start({ #EventMachienを使用してWebsocket server を起動 (簡単に言えば非同期処理できる)
+ :host => '0.0.0.0', #すべてのネットワーク・インターフェースを表す、別ホストからでもアクセスできる
+ :port => PORT,
+ # :secure => true
+}) do |em_ws|
+ clients_id_only[em_ws] = true
+ printf("現在の接続人数は %d 人です\n", clients_id_only.length)
+
+ em_ws.onopen do #onopen:クライエントが接続したときに呼び出されるイベント
+ em_ws.send "Ruby:接続されたよ!" #接続したクライエントにメッセージを送る
+ # printf("Ruby:clientが接続されました\n") #あとで誰が接続されたかデータ来るところにするーー
+ em_ws.send(button_clicker.to_json) #途中参加した人も現在の早押しの順番を反映させるためにjsonを送る
+ end
+
+ em_ws.onmessage do |msg| #onmassage:クライエントからメッセージを受信したときに呼び出されるイベント
+
+ # jsonデータかの判別
+ begin # 例外が発生する可能性のあるコードブロックの開始、このブロックでエラーがあれがrescue節に移る
+ data = JSON.parse(msg) #json -> hash に変更
+ # puts data
+ rescue => error # beginブロック内で例外が発生した場合に実行される、エラーはerrorという変数に格納
+ if msg.match(/ボタンを押しました/)
+ msg.match(/(team\d)\sの\s([0-9a-z]+)\s/)
+ hayaoshi(button_clicker, $1, $2)
+ clients_id_only.each do |key, value|
+ key.send(button_clicker.to_json)
+ key.send("pushed button");
+ end
+ p button_clicker
+ elsif msg == "reset"
+ button_clicker = []
+ p button_clicker
+ clients_id_only.each do |key, value|
+ key.send("reset");
+ end
+ end
+ # puts error.class
+ puts error.message
+ # puts error.backtrace
+ # puts msg
+ end
+ # em_ws.send "Ruby:サーバにメッセージ届きました!" #メッセージが来たことをクライエントに知らせる
+ end
+
+ em_ws.onclose do #クライエントが接続を閉じたときに呼び出されるイベント
+ puts "Ruby:clientが接続を閉じました" #あとで誰抜けたかデータ持ってくるーー
+ clients_id_only.delete(em_ws)
+ printf("現在の接続人数は %d 人です\n", clients_id_only.length)
+ end
+
+ em_ws.onerror do |error| #エラーが発生したときに呼び出されるイベント
+ puts "Ruby:Error: #{error.message}"
+ end
+
+ def hayaoshi(array, team, name)
+ flag = false
+ array.each do |key, value|
+ if key == team
+ flag = true
+ end
+ end
+ if flag == false
+ array.push([team, name])
+ return "#{team} の #{name} さんがボタンを押しました!"
+ else
+ return "#{team} はもう押してます!"
+ end
+ end
+
+end
diff --git "a/system/websocket_test/em-ws-web\050intro\051/server/server.html" "b/system/websocket_test/em-ws-web\050intro\051/server/server.html"
new file mode 100644
index 0000000..3977287
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/server/server.html"
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Server
+
+
+
+
songName
+
+
+
+
+
早押しボタンを押した順番
+
+
+
+
+
+
\ No newline at end of file
diff --git "a/system/websocket_test/em-ws-web\050intro\051/server/server.js" "b/system/websocket_test/em-ws-web\050intro\051/server/server.js"
new file mode 100644
index 0000000..803c1bd
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/server/server.js"
@@ -0,0 +1,116 @@
+function init() {
+ let songName = document.getElementById("songName"),
+ audio = document.getElementById("audio"),
+ previousSong = document.getElementById("previousSong"),
+ nextSong = document.getElementById("nextSong"),
+ speedButtonReset = document.getElementById("speedButtonReset"),
+ answerColumn = document.getElementById("answerColumn"),
+ counter = 1;
+
+ console.log(audio);
+ console.log(previousSong);
+ console.log(nextSong);
+
+ fetch("../mp3/mp3_path.csv")
+ .then((response) => {
+ return response.text();
+ })
+ .then((data) => {
+ let result = data.split(/\r?\n|\r/).map((e) => {
+ return e.split(",");
+ });
+ console.log(result);
+ console.log(`このCSVには ${result.length - 1}曲 登録されています。`);
+ songName.innerHTML = result[1][0];
+
+ nextSong.addEventListener("click", next, false);
+ previousSong.addEventListener("click", previous, false);
+
+ function previous() {
+ counter -= 1;
+ if (counter == 0) {
+ counter = result.length - 1;
+ }
+ songName.innerHTML = result[counter][0];
+ audio.src = result[counter][1];
+
+ socket.send("reset");
+ answerColumn.innerHTML = "";
+ }
+
+ function next() {
+ counter += 1;
+ if (counter == result.length) {
+ counter = 1;
+ }
+ songName.innerHTML = result[counter][0];
+ audio.src = result[counter][1];
+
+ socket.send("reset");
+ answerColumn.innerHTML = "";
+ }
+
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+
+ let socket;
+ function websocket() {
+ try {
+ if (!socket || socket.readyState !== 1) { //!socketは最初の接続のときに真になる、socket.readyStateは接続後に真になる
+
+ socket = new WebSocket('wss://www.koeki-prj.org/quiz2024');
+ // socket = new WebSocket('ws://localhost:8293');
+ socket.onopen = function (event) {
+ console.log("JS:接続されました!");
+ socket.send("JS:Hostです!")
+ };
+
+ socket.onmessage = function (event) {
+ let receivedMsg = event.data;
+ try {
+ button_clicker = JSON.parse(receivedMsg);
+ console.log(button_clicker);
+ answerColumn.innerHTML = "" //表示場所のリセット
+ for(let i = 0; i < button_clicker.length; i++) {
+ console.log(button_clicker[i][1]);
+ answerColumn.innerHTML += `${i + 1}: ${button_clicker[i][0]} の ${button_clicker[i][1]} です! `
+ }
+ } catch (error) {
+ console.log(event.data);
+ if (event.data.match(/pushed button/)) {
+ console.log(event.data);
+ audio.pause();
+ }
+ }
+ }
+
+ socket.onclose = function (event) {
+ if (event.wasClean) {
+ console.log("JS:切断しました!")
+ } else {
+ console.error("JS:切断エラーが起きました!");
+ }
+ }
+
+ socket.onerror = function (error) {
+ console.error("JS:WebSocket Error" + error)
+ }
+
+ speedButtonReset.addEventListener("click", reset, false);
+
+ function reset() {
+ socket.send("reset");
+ answerColumn.innerHTML = "";
+ }
+ }
+ } catch (error) {
+ console.error("エラーが発生しました!" + error);
+ }
+ }
+
+ document.addEventListener("DOMContentLoaded", websocket, false);
+}
+
+init()
diff --git "a/system/websocket_test/em-ws-web\050intro\051/template/client/client_websocket.js" "b/system/websocket_test/em-ws-web\050intro\051/template/client/client_websocket.js"
new file mode 100644
index 0000000..07dc7f1
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/template/client/client_websocket.js"
@@ -0,0 +1,42 @@
+// Node.js file
+function init() {
+ let socket;
+
+ function websocket() {
+ port = 8293;
+
+ try {
+ if (!socket || socket.readyState !== 1) { //!socketは最初の接続のときに真になる、socket.readyStateは接続後に真になる
+
+ socket = new WebSocket(`ws://localhost:/${port}`);
+ socket.onopen = function (event) {
+ console.log("JS:接続されました!");
+ };
+
+ socket.onmessage = function (event) {
+ try { //json判別
+ } catch (error) {
+ console.log(event.data);
+ }
+ }
+
+ socket.onclose = function (event) {
+ if (event.wasClean) {
+ console.log("JS:切断しました!")
+ } else {
+ console.error("JS:切断エラーが起きました!");
+ }
+ }
+
+ socket.onerror = function (error) {
+ console.error("JS:WebSocket Error" + error)
+ }
+ }
+ } catch (error) {
+ console.error("エラーが発生しました!" + error);
+ }
+ }
+ websocket()
+}
+
+init()
diff --git "a/system/websocket_test/em-ws-web\050intro\051/template/server/server_websocket.rb" "b/system/websocket_test/em-ws-web\050intro\051/template/server/server_websocket.rb"
new file mode 100644
index 0000000..9d9ccdb
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/template/server/server_websocket.rb"
@@ -0,0 +1,43 @@
+#!/usr/bin/env ruby
+
+require 'em-websocket' #websoketライブラリ
+require 'pp' #人間が読みやすいように表示してくれる
+require 'json' #json形式にしたり、直したりする
+
+PORT = 8293 #portを指定
+
+puts "参加者が入ったら表示するよ"
+
+EM::WebSocket.start({ #EventMachienを使用してWebsocket server を起動 (簡単に言えば非同期処理できる)
+ :host => '0.0.0.0', #すべてのネットワーク・インターフェースを表す、別ホストからでもアクセスできる
+ :port => PORT
+}) do |em_ws|
+ join_member[em_ws] = true
+ puts join_member.length
+
+ em_ws.onopen do #onopen:クライエントが接続したときに呼び出されるイベント
+ em_ws.send "Ruby:接続されたよ!" #接続したクライエントにメッセージを送る
+ printf("Ruby:clientが接続されました\n") #あとで誰が接続されたかデータ来るところにするーー
+ end
+
+ em_ws.onmessage do |msg| #onmassage:クライエントからメッセージを受信したときに呼び出されるイベント
+ # jsonデータかの判別
+ begin # 例外が発生する可能性のあるコードブロックの開始、このブロックでエラーがあれがrescue節に移る
+ rescue => error # beginブロック内で例外が発生した場合に実行される、エラーはerrorという変数に格納
+ puts error.message
+ puts msg
+ end
+ em_ws.send "Ruby:サーバにメッセージ届きました!" #メッセージが来たことをクライエントに知らせる
+ end
+
+ em_ws.onclose do #クライエントが接続を閉じたときに呼び出されるイベント
+ puts "Ruby:clientが接続を閉じました" #あとで誰抜けたかデータ持ってくるーー
+ join_member.delete(em_ws)
+ puts join_member.length
+ end
+
+ em_ws.onerror do |error| #エラーが発生したときに呼び出されるイベント
+ puts "Ruby:Error: #{error.message}"
+ end
+
+end
diff --git "a/system/websocket_test/em-ws-web\050intro\051/test/array.rb" "b/system/websocket_test/em-ws-web\050intro\051/test/array.rb"
new file mode 100755
index 0000000..bc40800
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/test/array.rb"
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby
+
+#make for array
+button_clicker = []
+
+def hayaoshi(button_clicker, team, name)
+ flag = false
+ button_clicker.each do |key, value|
+ if key == team
+ flag = true
+ end
+ end
+ if flag == false
+ button_clicker.push([team, name])
+ return printf("%s の %s さん!\n", team, name)
+ end
+end
+
+str = hayaoshi(button_clicker, "team2", "tsubasa")
+puts str
+# hayaoshi(button_clicker, "team2", "tubasa")
+# hayaoshi(button_clicker, "team1", "wow")
+
+# p button_clicker
+# button_clicker.each do |key, value|
+# printf("%s の %s さん!\n", key, value)
+# end
+
+
+# str = "team2 の tsubasa がボタンを押しました"
+# str.match(/(team\d)\sの\s([0-9a-z]+)\s/)
+# team = $1
+# name = $2
+# puts "team = #{team}, name = #{name}"
+
diff --git "a/system/websocket_test/em-ws-web\050intro\051/test/hash.rb" "b/system/websocket_test/em-ws-web\050intro\051/test/hash.rb"
new file mode 100755
index 0000000..4fa0961
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/test/hash.rb"
@@ -0,0 +1,156 @@
+#!/usr/bin/env ruby
+
+require 'pp'
+require 'json'
+
+# ------------------------------------
+# pp Set.new
+# pp Set.new([1,2])
+
+# client = Hash.new #Hashの作成
+# pp client
+
+# i = 0
+# while (i < 10)
+# client[i] = 'name' #nameのところにはhtmlで入力された名前を入れる
+# i += 1
+# end
+
+# pp client
+# print("hashの長さ(client)は", client.keys.length, "\n") #Hashの長さを調べる
+# ------------------------------------
+
+# ------------------------------------
+# hash = Hash.new
+# clients = Hash.new
+
+# hash = {
+# user1: {
+# id: nil,
+# team: 1
+# },
+# user2: {
+# id: nil,
+# team: 2
+# }
+# }
+
+# testHash = {
+# team1: {
+# id1: {
+# name: "name"
+# },
+# id2: {
+# name: "name"
+# }
+# },
+# team2: {
+# id3: {
+# name: "name"
+# },
+# id4: {
+# name: "name"
+# },
+# id5: {
+# name: "naem"
+# }
+# }
+# }
+
+# puts testHash
+# puts testHash.length
+# puts testHash[:team1].length
+# i = 1
+# puts testHash[:"team#{i}"].keys.length
+# def sum(testHash)
+# i = 0
+# sum_clients = 0
+# while i < testHash.length
+# i += 1
+# sum_clients += testHash[:"team#{i}"].keys.length
+# end
+# return sum_clients
+# end
+
+# puts sum(testHash)
+
+#全てのチームを虱潰しに探して、削除したいkeyを見つけたらそれをハッシュから削除するコード
+# def delete_hash(testHash, delete_key)
+# i = 0
+# j = 0
+# while i < testHash.length
+# i += 1
+# while j < testHash[:"team#{i}"].keys.length
+# if testHash[:"team#{i}"].keys[j] == delete_key
+# testHash[:"team#{i}"].delete(testHash[:"team#{i}"].keys[j])
+# end
+# j += 1
+# end
+# j = 0
+# end
+# return testHash
+# end
+
+# def sum_clients(clients)
+# i = 0
+# sum = 0
+# while i < clients.length
+# i += 1
+# sum += clients[:"team#{i}"].keys.length
+# end
+# return sum
+# end
+
+# puts sum_clients(testHash)
+# puts delete_hash(testHash, :id3)
+
+# puts hash
+
+# hash[:user3] = {id: nil, team: 2}
+# pp hash
+
+# # 絞り込んで出力
+# puts hash[:user2]
+# puts hash[:user2][:team]
+
+# # jsonにする
+# json_hash = hash.to_json
+# puts json_hash
+
+# # 一番最初のuserの部分を変更する
+# hash[:user4] = hash.delete(:user1)
+
+# # 違うhashに追加する
+# puts hash
+# clients = clients.merge(hash)
+# puts clients
+
+# puts clients.keys.length
+# ------------------------------------
+
+hayaoshi_hash = {}
+
+# hash の追加
+
+p hayaoshi_hash
+
+def push(hayaoshi_hash, push_data)
+ flag = false
+ hayaoshi_hash.each do |key, value|
+ if push_data.keys[0] == key
+ flag = true
+ end
+ end
+ puts flag
+ if flag == false
+ hayaoshi_hash[push_data.keys[0]] = push_data.values[0]
+ end
+ return hayaoshi_hash
+end
+
+push(hayaoshi_hash, {"team2": "tututu"})
+p hayaoshi_hash
+push(hayaoshi_hash, {"team1": "bababa"})
+p hayaoshi_hash
+push(hayaoshi_hash, {"team2": "fasfafa"})
+p hayaoshi_hash
\ No newline at end of file
diff --git "a/system/websocket_test/em-ws-web\050intro\051/test/operate_str.rb" "b/system/websocket_test/em-ws-web\050intro\051/test/operate_str.rb"
new file mode 100755
index 0000000..84d3965
--- /dev/null
+++ "b/system/websocket_test/em-ws-web\050intro\051/test/operate_str.rb"
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+str = "#"0.0.0.0", :port=>8293}, @debug=false, @secure=false, @secure_proxy=false, @tls_options={}, @close_timeout=nil, @outbound_limit=0, @handler=nil>"
+match = str.match(/0x[0-9a-f]+/)
+puts match[0]
\ No newline at end of file
diff --git a/system/websocket_test/node_modules/.bin/node-gyp-build b/system/websocket_test/node_modules/.bin/node-gyp-build
deleted file mode 120000
index 671c6eb..0000000
--- a/system/websocket_test/node_modules/.bin/node-gyp-build
+++ /dev/null
@@ -1 +0,0 @@
-../node-gyp-build/bin.js
\ No newline at end of file
diff --git a/system/websocket_test/node_modules/.bin/node-gyp-build-optional b/system/websocket_test/node_modules/.bin/node-gyp-build-optional
deleted file mode 120000
index 46d347e..0000000
--- a/system/websocket_test/node_modules/.bin/node-gyp-build-optional
+++ /dev/null
@@ -1 +0,0 @@
-../node-gyp-build/optional.js
\ No newline at end of file
diff --git a/system/websocket_test/node_modules/.bin/node-gyp-build-test b/system/websocket_test/node_modules/.bin/node-gyp-build-test
deleted file mode 120000
index d11de1b..0000000
--- a/system/websocket_test/node_modules/.bin/node-gyp-build-test
+++ /dev/null
@@ -1 +0,0 @@
-../node-gyp-build/build-test.js
\ No newline at end of file
diff --git a/system/websocket_test/node_modules/.package-lock.json b/system/websocket_test/node_modules/.package-lock.json
deleted file mode 100644
index 3401f1a..0000000
--- a/system/websocket_test/node_modules/.package-lock.json
+++ /dev/null
@@ -1,182 +0,0 @@
-{
- "name": "websocket_test",
- "version": "1.0.0",
- "lockfileVersion": 2,
- "requires": true,
- "packages": {
- "node_modules/bufferutil": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
- "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
- "hasInstallScript": true,
- "dependencies": {
- "node-gyp-build": "^4.3.0"
- },
- "engines": {
- "node": ">=6.14.2"
- }
- },
- "node_modules/d": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz",
- "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
- "dependencies": {
- "es5-ext": "^0.10.64",
- "type": "^2.7.2"
- },
- "engines": {
- "node": ">=0.12"
- }
- },
- "node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/es5-ext": {
- "version": "0.10.64",
- "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
- "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
- "hasInstallScript": true,
- "dependencies": {
- "es6-iterator": "^2.0.3",
- "es6-symbol": "^3.1.3",
- "esniff": "^2.0.1",
- "next-tick": "^1.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/es6-iterator": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
- "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
- "dependencies": {
- "d": "1",
- "es5-ext": "^0.10.35",
- "es6-symbol": "^3.1.1"
- }
- },
- "node_modules/es6-symbol": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz",
- "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
- "dependencies": {
- "d": "^1.0.2",
- "ext": "^1.7.0"
- },
- "engines": {
- "node": ">=0.12"
- }
- },
- "node_modules/esniff": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
- "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
- "dependencies": {
- "d": "^1.0.1",
- "es5-ext": "^0.10.62",
- "event-emitter": "^0.3.5",
- "type": "^2.7.2"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/event-emitter": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
- "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
- "dependencies": {
- "d": "1",
- "es5-ext": "~0.10.14"
- }
- },
- "node_modules/ext": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
- "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
- "dependencies": {
- "type": "^2.7.2"
- }
- },
- "node_modules/is-typedarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="
- },
- "node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
- },
- "node_modules/next-tick": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
- "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
- },
- "node_modules/node-gyp-build": {
- "version": "4.8.0",
- "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz",
- "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==",
- "bin": {
- "node-gyp-build": "bin.js",
- "node-gyp-build-optional": "optional.js",
- "node-gyp-build-test": "build-test.js"
- }
- },
- "node_modules/type": {
- "version": "2.7.2",
- "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
- "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
- },
- "node_modules/typedarray-to-buffer": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
- "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
- "dependencies": {
- "is-typedarray": "^1.0.0"
- }
- },
- "node_modules/utf-8-validate": {
- "version": "5.0.10",
- "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
- "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
- "hasInstallScript": true,
- "dependencies": {
- "node-gyp-build": "^4.3.0"
- },
- "engines": {
- "node": ">=6.14.2"
- }
- },
- "node_modules/websocket": {
- "version": "1.0.34",
- "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz",
- "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==",
- "dependencies": {
- "bufferutil": "^4.0.1",
- "debug": "^2.2.0",
- "es5-ext": "^0.10.50",
- "typedarray-to-buffer": "^3.1.5",
- "utf-8-validate": "^5.0.2",
- "yaeti": "^0.0.6"
- },
- "engines": {
- "node": ">=4.0.0"
- }
- },
- "node_modules/yaeti": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
- "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==",
- "engines": {
- "node": ">=0.10.32"
- }
- }
- }
-}
diff --git a/system/websocket_test/node_modules/bufferutil/LICENSE b/system/websocket_test/node_modules/bufferutil/LICENSE
deleted file mode 100644
index 1da5b96..0000000
--- a/system/websocket_test/node_modules/bufferutil/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2011 Einar Otto Stangvik
-Copyright (c) 2013 Arnout Kazemier and contributors
-Copyright (c) 2016 Luigi Pinca and contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/system/websocket_test/node_modules/bufferutil/README.md b/system/websocket_test/node_modules/bufferutil/README.md
deleted file mode 100644
index 6dc056e..0000000
--- a/system/websocket_test/node_modules/bufferutil/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# bufferutil
-
-[](https://www.npmjs.com/package/bufferutil)
-[](https://github.com/websockets/bufferutil/actions?query=workflow%3ACI+branch%3Amaster)
-
-`bufferutil` is what makes `ws` fast. It provides some utilities to efficiently
-perform some operations such as masking and unmasking the data payload of
-WebSocket frames.
-
-## Installation
-
-```
-npm install bufferutil --save-optional
-```
-
-The `--save-optional` flag tells npm to save the package in your package.json
-under the
-[`optionalDependencies`](https://docs.npmjs.com/files/package.json#optionaldependencies)
-key.
-
-## API
-
-The module exports two functions.
-
-### `bufferUtil.mask(source, mask, output, offset, length)`
-
-Masks a buffer using the given masking-key as specified by the WebSocket
-protocol.
-
-#### Arguments
-
-- `source` - The buffer to mask.
-- `mask` - A buffer representing the masking-key.
-- `output` - The buffer where to store the result.
-- `offset` - The offset at which to start writing.
-- `length` - The number of bytes to mask.
-
-#### Example
-
-```js
-'use strict';
-
-const bufferUtil = require('bufferutil');
-const crypto = require('crypto');
-
-const source = crypto.randomBytes(10);
-const mask = crypto.randomBytes(4);
-
-bufferUtil.mask(source, mask, source, 0, source.length);
-```
-
-### `bufferUtil.unmask(buffer, mask)`
-
-Unmasks a buffer using the given masking-key as specified by the WebSocket
-protocol.
-
-#### Arguments
-
-- `buffer` - The buffer to unmask.
-- `mask` - A buffer representing the masking-key.
-
-#### Example
-
-```js
-'use strict';
-
-const bufferUtil = require('bufferutil');
-const crypto = require('crypto');
-
-const buffer = crypto.randomBytes(10);
-const mask = crypto.randomBytes(4);
-
-bufferUtil.unmask(buffer, mask);
-```
-
-## License
-
-[MIT](LICENSE)
diff --git a/system/websocket_test/node_modules/bufferutil/binding.gyp b/system/websocket_test/node_modules/bufferutil/binding.gyp
deleted file mode 100644
index 168b58a..0000000
--- a/system/websocket_test/node_modules/bufferutil/binding.gyp
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- 'targets': [
- {
- 'target_name': 'bufferutil',
- 'sources': ['src/bufferutil.c'],
- 'cflags': ['-std=c99'],
- 'conditions': [
- ["OS=='mac'", {
- 'variables': {
- 'clang_version':
- '&1 | perl -ne \'print $1 if /clang version ([0-9]+(\.[0-9]+){2,})/\')'
- },
- 'xcode_settings': {
- 'MACOSX_DEPLOYMENT_TARGET': '10.7'
- },
- 'conditions': [
- # Use Perl v-strings to compare versions.
- ['clang_version and {
- for (var i = 0; i < length; i++) {
- output[offset + i] = source[i] ^ mask[i & 3];
- }
-};
-
-/**
- * Unmasks a buffer using the given mask.
- *
- * @param {Buffer} buffer The buffer to unmask
- * @param {Buffer} mask The mask to use
- * @public
- */
-const unmask = (buffer, mask) => {
- // Required until https://github.com/nodejs/node/issues/9006 is resolved.
- const length = buffer.length;
- for (var i = 0; i < length; i++) {
- buffer[i] ^= mask[i & 3];
- }
-};
-
-module.exports = { mask, unmask };
diff --git a/system/websocket_test/node_modules/bufferutil/index.js b/system/websocket_test/node_modules/bufferutil/index.js
deleted file mode 100644
index 8c30561..0000000
--- a/system/websocket_test/node_modules/bufferutil/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-try {
- module.exports = require('node-gyp-build')(__dirname);
-} catch (e) {
- module.exports = require('./fallback');
-}
diff --git a/system/websocket_test/node_modules/bufferutil/package.json b/system/websocket_test/node_modules/bufferutil/package.json
deleted file mode 100644
index 8518951..0000000
--- a/system/websocket_test/node_modules/bufferutil/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "bufferutil",
- "version": "4.0.8",
- "description": "WebSocket buffer utils",
- "main": "index.js",
- "engines": {
- "node": ">=6.14.2"
- },
- "scripts": {
- "install": "node-gyp-build",
- "prebuild": "prebuildify --napi --strip --target=14.0.0",
- "prebuild-darwin-x64+arm64": "prebuildify --arch x64+arm64 --napi --strip --target=14.0.0",
- "test": "mocha"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/websockets/bufferutil"
- },
- "keywords": [
- "bufferutil"
- ],
- "author": "Einar Otto Stangvik (http://2x.io)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/websockets/bufferutil/issues"
- },
- "homepage": "https://github.com/websockets/bufferutil",
- "dependencies": {
- "node-gyp-build": "^4.3.0"
- },
- "devDependencies": {
- "mocha": "^10.0.0",
- "node-gyp": "^9.1.0",
- "prebuildify": "^5.0.0"
- }
-}
diff --git a/system/websocket_test/node_modules/bufferutil/prebuilds/darwin-x64+arm64/node.napi.node b/system/websocket_test/node_modules/bufferutil/prebuilds/darwin-x64+arm64/node.napi.node
deleted file mode 100644
index 0840a8b..0000000
--- a/system/websocket_test/node_modules/bufferutil/prebuilds/darwin-x64+arm64/node.napi.node
+++ /dev/null
Binary files differ
diff --git a/system/websocket_test/node_modules/bufferutil/prebuilds/linux-x64/node.napi.node b/system/websocket_test/node_modules/bufferutil/prebuilds/linux-x64/node.napi.node
deleted file mode 100644
index b30f827..0000000
--- a/system/websocket_test/node_modules/bufferutil/prebuilds/linux-x64/node.napi.node
+++ /dev/null
Binary files differ
diff --git a/system/websocket_test/node_modules/bufferutil/prebuilds/win32-ia32/node.napi.node b/system/websocket_test/node_modules/bufferutil/prebuilds/win32-ia32/node.napi.node
deleted file mode 100644
index 0af1011..0000000
--- a/system/websocket_test/node_modules/bufferutil/prebuilds/win32-ia32/node.napi.node
+++ /dev/null
Binary files differ
diff --git a/system/websocket_test/node_modules/bufferutil/prebuilds/win32-x64/node.napi.node b/system/websocket_test/node_modules/bufferutil/prebuilds/win32-x64/node.napi.node
deleted file mode 100644
index f4ba07f..0000000
--- a/system/websocket_test/node_modules/bufferutil/prebuilds/win32-x64/node.napi.node
+++ /dev/null
Binary files differ
diff --git a/system/websocket_test/node_modules/bufferutil/src/bufferutil.c b/system/websocket_test/node_modules/bufferutil/src/bufferutil.c
deleted file mode 100644
index b89f8dd..0000000
--- a/system/websocket_test/node_modules/bufferutil/src/bufferutil.c
+++ /dev/null
@@ -1,171 +0,0 @@
-#define NAPI_VERSION 1
-#include
-#include
-
-napi_value Mask(napi_env env, napi_callback_info info) {
- napi_status status;
- size_t argc = 5;
- napi_value argv[5];
-
- status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
- assert(status == napi_ok);
-
- uint8_t *source;
- uint8_t *mask;
- uint8_t *destination;
- uint32_t offset;
- uint32_t length;
-
- status = napi_get_buffer_info(env, argv[0], (void **)&source, NULL);
- assert(status == napi_ok);
-
- status = napi_get_buffer_info(env, argv[1], (void **)&mask, NULL);
- assert(status == napi_ok);
-
- status = napi_get_buffer_info(env, argv[2], (void **)&destination, NULL);
- assert(status == napi_ok);
-
- status = napi_get_value_uint32(env, argv[3], &offset);
- assert(status == napi_ok);
-
- status = napi_get_value_uint32(env, argv[4], &length);
- assert(status == napi_ok);
-
- destination += offset;
- uint32_t index = 0;
-
- //
- // Alignment preamble.
- //
- while (index < length && ((size_t)source % 8)) {
- *destination++ = *source++ ^ mask[index % 4];
- index++;
- }
-
- length -= index;
- if (!length)
- return NULL;
-
- //
- // Realign mask and convert to 64 bit.
- //
- uint8_t maskAlignedArray[8];
-
- for (uint8_t i = 0; i < 8; i++, index++) {
- maskAlignedArray[i] = mask[index % 4];
- }
-
- //
- // Apply 64 bit mask in 8 byte chunks.
- //
- uint32_t loop = length / 8;
- uint64_t *pMask8 = (uint64_t *)maskAlignedArray;
-
- while (loop--) {
- uint64_t *pFrom8 = (uint64_t *)source;
- uint64_t *pTo8 = (uint64_t *)destination;
- *pTo8 = *pFrom8 ^ *pMask8;
- source += 8;
- destination += 8;
- }
-
- //
- // Apply mask to remaining data.
- //
- uint8_t *pmaskAlignedArray = maskAlignedArray;
-
- length %= 8;
- while (length--) {
- *destination++ = *source++ ^ *pmaskAlignedArray++;
- }
-
- return NULL;
-}
-
-napi_value Unmask(napi_env env, napi_callback_info info) {
- napi_status status;
- size_t argc = 2;
- napi_value argv[2];
-
- status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
- assert(status == napi_ok);
-
- uint8_t *source;
- size_t length;
- uint8_t *mask;
-
- status = napi_get_buffer_info(env, argv[0], (void **)&source, &length);
- assert(status == napi_ok);
-
- status = napi_get_buffer_info(env, argv[1], (void **)&mask, NULL);
- assert(status == napi_ok);
-
- uint32_t index = 0;
-
- //
- // Alignment preamble.
- //
- while (index < length && ((size_t)source % 8)) {
- *source++ ^= mask[index % 4];
- index++;
- }
-
- length -= index;
- if (!length)
- return NULL;
-
- //
- // Realign mask and convert to 64 bit.
- //
- uint8_t maskAlignedArray[8];
-
- for (uint8_t i = 0; i < 8; i++, index++) {
- maskAlignedArray[i] = mask[index % 4];
- }
-
- //
- // Apply 64 bit mask in 8 byte chunks.
- //
- uint32_t loop = length / 8;
- uint64_t *pMask8 = (uint64_t *)maskAlignedArray;
-
- while (loop--) {
- uint64_t *pSource8 = (uint64_t *)source;
- *pSource8 ^= *pMask8;
- source += 8;
- }
-
- //
- // Apply mask to remaining data.
- //
- uint8_t *pmaskAlignedArray = maskAlignedArray;
-
- length %= 8;
- while (length--) {
- *source++ ^= *pmaskAlignedArray++;
- }
-
- return NULL;
-}
-
-napi_value Init(napi_env env, napi_value exports) {
- napi_status status;
- napi_value mask;
- napi_value unmask;
-
- status = napi_create_function(env, NULL, 0, Mask, NULL, &mask);
- assert(status == napi_ok);
-
- status = napi_create_function(env, NULL, 0, Unmask, NULL, &unmask);
- assert(status == napi_ok);
-
- status = napi_set_named_property(env, exports, "mask", mask);
- assert(status == napi_ok);
-
- status = napi_set_named_property(env, exports, "unmask", unmask);
- assert(status == napi_ok);
-
- return exports;
-}
-
-NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)
diff --git a/system/websocket_test/node_modules/d/CHANGELOG.md b/system/websocket_test/node_modules/d/CHANGELOG.md
deleted file mode 100644
index 52e8617..0000000
--- a/system/websocket_test/node_modules/d/CHANGELOG.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-### [1.0.2](https://github.com/medikoo/d/compare/v1.0.1...v1.0.2) (2024-03-01)
-
-### Maintenance Improvements
-
-- Upgrade `type` to v2 ([43b0eb8](https://github.com/medikoo/d/commit/43b0eb845d9efad3450e0e641ea1a827a5ba1966))
-
-### [1.0.1](https://github.com/medikoo/d/compare/v0.1.1...v1.0.1) (2019-06-14)
-
-## Changelog for previous versions
-
-See `CHANGES` file
diff --git a/system/websocket_test/node_modules/d/CHANGES b/system/websocket_test/node_modules/d/CHANGES
deleted file mode 100644
index 73234d5..0000000
--- a/system/websocket_test/node_modules/d/CHANGES
+++ /dev/null
@@ -1,17 +0,0 @@
-For recent changelog see CHANGELOG.md
-
------
-
-v1.0.0 -- 2015.12.04
-- autoBind changes:
- - replace `bindTo` argument with options and `resolveContext` option
- - Add support `overwriteDefinition`
-- Introduce IE11 bug workaround in `lazy` handler
-
-v0.1.1 -- 2014.04.24
-- Add `autoBind` and `lazy` utilities
-- Allow to pass other options to be merged onto created descriptor.
- Useful when used with other custom utilties
-
-v0.1.0 -- 2013.06.20
-Initial (derived from es5-ext project)
diff --git a/system/websocket_test/node_modules/d/LICENSE b/system/websocket_test/node_modules/d/LICENSE
deleted file mode 100644
index 38d8a75..0000000
--- a/system/websocket_test/node_modules/d/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2013-2024, Mariusz Nowak, @medikoo, medikoo.com
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/system/websocket_test/node_modules/d/README.md b/system/websocket_test/node_modules/d/README.md
deleted file mode 100644
index c28508f..0000000
--- a/system/websocket_test/node_modules/d/README.md
+++ /dev/null
@@ -1,129 +0,0 @@
-[![Build status][build-image]][build-url]
-[![Tests coverage][cov-image]][cov-url]
-[![npm version][npm-image]][npm-url]
-
-# d
-
-## Property descriptor factory
-
-_Originally derived from [d](https://github.com/medikoo/d) package._
-
-Defining properties with descriptors is very verbose:
-
-```javascript
-var Account = function () {};
-Object.defineProperties(Account.prototype, {
- deposit: {
- value: function () { /* ... */ },
- configurable: true,
- enumerable: false,
- writable: true
- },
- withdraw: {
- value: function () { /* ... */ },
- configurable: true,
- enumerable: false,
- writable: true
- },
- balance: { get: function () { /* ... */ }, configurable: true, enumerable: false }
-});
-```
-
-D cuts that to:
-
-```javascript
-var d = require("d");
-
-var Account = function () {};
-Object.defineProperties(Account.prototype, {
- deposit: d(function () { /* ... */ }),
- withdraw: d(function () { /* ... */ }),
- balance: d.gs(function () { /* ... */ })
-});
-```
-
-By default, created descriptor follow characteristics of native ES5 properties, and defines values as:
-
-```javascript
-{ configurable: true, enumerable: false, writable: true }
-```
-
-You can overwrite it by preceding _value_ argument with instruction:
-
-```javascript
-d("c", value); // { configurable: true, enumerable: false, writable: false }
-d("ce", value); // { configurable: true, enumerable: true, writable: false }
-d("e", value); // { configurable: false, enumerable: true, writable: false }
-
-// Same way for get/set:
-d.gs("e", value); // { configurable: false, enumerable: true }
-```
-
-### Installation
-
- $ npm install d
-
-To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
-
-### Other utilities
-
-#### autoBind(obj, props) _(d/auto-bind)_
-
-Define methods which will be automatically bound to its instances
-
-```javascript
-var d = require('d');
-var autoBind = require('d/auto-bind');
-
-var Foo = function () { this._count = 0; };
-Object.defineProperties(Foo.prototype, autoBind({
- increment: d(function () { ++this._count; });
-}));
-
-var foo = new Foo();
-
-// Increment foo counter on each domEl click
-domEl.addEventListener('click', foo.increment, false);
-```
-
-#### lazy(obj, props) _(d/lazy)_
-
-Define lazy properties, which will be resolved on first access
-
-```javascript
-var d = require("d");
-var lazy = require("d/lazy");
-
-var Foo = function () {};
-Object.defineProperties(Foo.prototype, lazy({ items: d(function () { return []; }) }));
-
-var foo = new Foo();
-foo.items.push(1, 2); // foo.items array created and defined directly on foo
-```
-
-## Tests
-
- $ npm test
-
-## Security contact information
-
-To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
-
----
-
-
-
- Get professional support for d with a Tidelift subscription
-
-
-
- Tidelift helps make open source sustainable for maintainers while giving companies assurances about security, maintenance, and licensing for their dependencies.
-
-
-
- Get professional support for d with a Tidelift subscription
-
-
-
- Tidelift helps make open source sustainable for maintainers while giving companies assurances about security, maintenance, and licensing for their dependencies.
-
-
-
-[build-image]: https://github.com/medikoo/es6-symbol/workflows/Integrate/badge.svg
-[build-url]: https://github.com/medikoo/es6-symbol/actions?query=workflow%3AIntegrate
-[cov-image]: https://img.shields.io/codecov/c/github/medikoo/es6-symbol.svg
-[cov-url]: https://codecov.io/gh/medikoo/es6-symbol
-[npm-image]: https://img.shields.io/npm/v/es6-symbol.svg
-[npm-url]: https://www.npmjs.com/package/es6-symbol
diff --git a/system/websocket_test/node_modules/es6-symbol/implement.js b/system/websocket_test/node_modules/es6-symbol/implement.js
deleted file mode 100644
index d62803b..0000000
--- a/system/websocket_test/node_modules/es6-symbol/implement.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-if (!require("./is-implemented")()) {
- Object.defineProperty(require("ext/global-this"), "Symbol", {
- value: require("./polyfill"),
- configurable: true,
- enumerable: false,
- writable: true
- });
-}
diff --git a/system/websocket_test/node_modules/es6-symbol/index.js b/system/websocket_test/node_modules/es6-symbol/index.js
deleted file mode 100644
index fcd8a63..0000000
--- a/system/websocket_test/node_modules/es6-symbol/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-module.exports = require("./is-implemented")()
- ? require("ext/global-this").Symbol
- : require("./polyfill");
diff --git a/system/websocket_test/node_modules/es6-symbol/is-implemented.js b/system/websocket_test/node_modules/es6-symbol/is-implemented.js
deleted file mode 100644
index b85ec69..0000000
--- a/system/websocket_test/node_modules/es6-symbol/is-implemented.js
+++ /dev/null
@@ -1,20 +0,0 @@
-"use strict";
-
-var global = require("ext/global-this")
- , validTypes = { object: true, symbol: true };
-
-module.exports = function () {
- var Symbol = global.Symbol;
- var symbol;
- if (typeof Symbol !== "function") return false;
- symbol = Symbol("test symbol");
- try { String(symbol); }
- catch (e) { return false; }
-
- // Return 'true' also for polyfills
- if (!validTypes[typeof Symbol.iterator]) return false;
- if (!validTypes[typeof Symbol.toPrimitive]) return false;
- if (!validTypes[typeof Symbol.toStringTag]) return false;
-
- return true;
-};
diff --git a/system/websocket_test/node_modules/es6-symbol/is-native-implemented.js b/system/websocket_test/node_modules/es6-symbol/is-native-implemented.js
deleted file mode 100644
index 254774a..0000000
--- a/system/websocket_test/node_modules/es6-symbol/is-native-implemented.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Exports true if environment provides native `Symbol` implementation
-
-"use strict";
-
-var Symbol = require("ext/global-this").Symbol;
-
-module.exports = typeof Symbol === "function" && typeof Symbol() === "symbol";
diff --git a/system/websocket_test/node_modules/es6-symbol/is-symbol.js b/system/websocket_test/node_modules/es6-symbol/is-symbol.js
deleted file mode 100644
index 66edd46..0000000
--- a/system/websocket_test/node_modules/es6-symbol/is-symbol.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-module.exports = function (value) {
- if (!value) return false;
- if (typeof value === "symbol") return true;
- if (!value.constructor) return false;
- if (value.constructor.name !== "Symbol") return false;
- return value[value.constructor.toStringTag] === "Symbol";
-};
diff --git a/system/websocket_test/node_modules/es6-symbol/lib/private/generate-name.js b/system/websocket_test/node_modules/es6-symbol/lib/private/generate-name.js
deleted file mode 100644
index 880f25e..0000000
--- a/system/websocket_test/node_modules/es6-symbol/lib/private/generate-name.js
+++ /dev/null
@@ -1,28 +0,0 @@
-"use strict";
-
-var d = require("d");
-
-var create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype;
-
-var created = create(null);
-module.exports = function (desc) {
- var postfix = 0, name, ie11BugWorkaround;
- while (created[desc + (postfix || "")]) ++postfix;
- desc += postfix || "";
- created[desc] = true;
- name = "@@" + desc;
- defineProperty(
- objPrototype, name,
- d.gs(null, function (value) {
- // For IE11 issue see:
- // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
- // ie11-broken-getters-on-dom-objects
- // https://github.com/medikoo/es6-symbol/issues/12
- if (ie11BugWorkaround) return;
- ie11BugWorkaround = true;
- defineProperty(this, name, d(value));
- ie11BugWorkaround = false;
- })
- );
- return name;
-};
diff --git a/system/websocket_test/node_modules/es6-symbol/lib/private/setup/standard-symbols.js b/system/websocket_test/node_modules/es6-symbol/lib/private/setup/standard-symbols.js
deleted file mode 100644
index b25b171..0000000
--- a/system/websocket_test/node_modules/es6-symbol/lib/private/setup/standard-symbols.js
+++ /dev/null
@@ -1,34 +0,0 @@
-"use strict";
-
-var d = require("d")
- , NativeSymbol = require("ext/global-this").Symbol;
-
-module.exports = function (SymbolPolyfill) {
- return Object.defineProperties(SymbolPolyfill, {
- // To ensure proper interoperability with other native functions (e.g. Array.from)
- // fallback to eventual native implementation of given symbol
- hasInstance: d(
- "", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill("hasInstance")
- ),
- isConcatSpreadable: d(
- "",
- (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
- SymbolPolyfill("isConcatSpreadable")
- ),
- iterator: d("", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill("iterator")),
- match: d("", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill("match")),
- replace: d("", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill("replace")),
- search: d("", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill("search")),
- species: d("", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill("species")),
- split: d("", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill("split")),
- toPrimitive: d(
- "", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill("toPrimitive")
- ),
- toStringTag: d(
- "", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill("toStringTag")
- ),
- unscopables: d(
- "", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill("unscopables")
- )
- });
-};
diff --git a/system/websocket_test/node_modules/es6-symbol/lib/private/setup/symbol-registry.js b/system/websocket_test/node_modules/es6-symbol/lib/private/setup/symbol-registry.js
deleted file mode 100644
index 29d198f..0000000
--- a/system/websocket_test/node_modules/es6-symbol/lib/private/setup/symbol-registry.js
+++ /dev/null
@@ -1,23 +0,0 @@
-"use strict";
-
-var d = require("d")
- , validateSymbol = require("../../../validate-symbol");
-
-var registry = Object.create(null);
-
-module.exports = function (SymbolPolyfill) {
- return Object.defineProperties(SymbolPolyfill, {
- for: d(function (key) {
- if (registry[key]) return registry[key];
- return (registry[key] = SymbolPolyfill(String(key)));
- }),
- keyFor: d(function (symbol) {
- var key;
- validateSymbol(symbol);
- for (key in registry) {
- if (registry[key] === symbol) return key;
- }
- return undefined;
- })
- });
-};
diff --git a/system/websocket_test/node_modules/es6-symbol/package.json b/system/websocket_test/node_modules/es6-symbol/package.json
deleted file mode 100644
index a2cb8d0..0000000
--- a/system/websocket_test/node_modules/es6-symbol/package.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "name": "es6-symbol",
- "version": "3.1.4",
- "description": "ECMAScript 6 Symbol polyfill",
- "author": "Mariusz Nowak (http://www.medikoo.com/)",
- "keywords": [
- "symbol",
- "private",
- "property",
- "es6",
- "ecmascript",
- "harmony",
- "ponyfill",
- "polyfill"
- ],
- "repository": "medikoo/es6-symbol",
- "dependencies": {
- "d": "^1.0.2",
- "ext": "^1.7.0"
- },
- "devDependencies": {
- "eslint": "^8.57.0",
- "eslint-config-medikoo": "^4.2.0",
- "git-list-updated": "^1.2.1",
- "github-release-from-cc-changelog": "^2.3.0",
- "husky": "^4.3.8",
- "lint-staged": "~13.2.3",
- "nyc": "^15.1.0",
- "prettier-elastic": "^2.8.8",
- "tad": "^3.1.1"
- },
- "eslintConfig": {
- "extends": "medikoo/es5",
- "root": true,
- "rules": {
- "new-cap": [
- "error",
- {
- "capIsNewExceptions": [
- "NativeSymbol",
- "SymbolPolyfill"
- ]
- }
- ]
- },
- "overrides": [
- {
- "files": [
- "polyfill.js"
- ],
- "rules": {
- "func-names": "off"
- }
- },
- {
- "files": [
- "test/*.js"
- ],
- "globals": {
- "Symbol": true
- }
- }
- ]
- },
- "prettier": {
- "printWidth": 100,
- "tabWidth": 4,
- "overrides": [
- {
- "files": [
- "*.md",
- "*.yml"
- ],
- "options": {
- "tabWidth": 2
- }
- }
- ]
- },
- "husky": {
- "hooks": {
- "pre-commit": "lint-staged"
- }
- },
- "lint-staged": {
- "*.js": [
- "eslint"
- ],
- "*.{css,html,js,json,md,yaml,yml}": [
- "prettier -c"
- ]
- },
- "scripts": {
- "coverage": "nyc npm test",
- "lint": "eslint --ignore-path=.gitignore .",
- "lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
- "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
- "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
- "test": "tad"
- },
- "engines": {
- "node": ">=0.12"
- },
- "license": "ISC"
-}
diff --git a/system/websocket_test/node_modules/es6-symbol/polyfill.js b/system/websocket_test/node_modules/es6-symbol/polyfill.js
deleted file mode 100644
index 01a9e61..0000000
--- a/system/websocket_test/node_modules/es6-symbol/polyfill.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// ES2015 Symbol polyfill for environments that do not (or partially) support it
-
-"use strict";
-
-var d = require("d")
- , validateSymbol = require("./validate-symbol")
- , NativeSymbol = require("ext/global-this").Symbol
- , generateName = require("./lib/private/generate-name")
- , setupStandardSymbols = require("./lib/private/setup/standard-symbols")
- , setupSymbolRegistry = require("./lib/private/setup/symbol-registry");
-
-var create = Object.create
- , defineProperties = Object.defineProperties
- , defineProperty = Object.defineProperty;
-
-var SymbolPolyfill, HiddenSymbol, isNativeSafe;
-
-if (typeof NativeSymbol === "function") {
- try {
- String(NativeSymbol());
- isNativeSafe = true;
- } catch (ignore) {}
-} else {
- NativeSymbol = null;
-}
-
-// Internal constructor (not one exposed) for creating Symbol instances.
-// This one is used to ensure that `someSymbol instanceof Symbol` always return false
-HiddenSymbol = function Symbol(description) {
- if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor");
- return SymbolPolyfill(description);
-};
-
-// Exposed `Symbol` constructor
-// (returns instances of HiddenSymbol)
-module.exports = SymbolPolyfill = function Symbol(description) {
- var symbol;
- if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor");
- if (isNativeSafe) return NativeSymbol(description);
- symbol = create(HiddenSymbol.prototype);
- description = description === undefined ? "" : String(description);
- return defineProperties(symbol, {
- __description__: d("", description),
- __name__: d("", generateName(description))
- });
-};
-
-setupStandardSymbols(SymbolPolyfill);
-setupSymbolRegistry(SymbolPolyfill);
-
-// Internal tweaks for real symbol producer
-defineProperties(HiddenSymbol.prototype, {
- constructor: d(SymbolPolyfill),
- toString: d("", function () { return this.__name__; })
-});
-
-// Proper implementation of methods exposed on Symbol.prototype
-// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
-defineProperties(SymbolPolyfill.prototype, {
- toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }),
- valueOf: d(function () { return validateSymbol(this); })
-});
-defineProperty(
- SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive,
- d("", function () {
- var symbol = validateSymbol(this);
- if (typeof symbol === "symbol") return symbol;
- return symbol.toString();
- })
-);
-defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol"));
-
-// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
-defineProperty(
- HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
- d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])
-);
-
-// Note: It's important to define `toPrimitive` as last one, as some implementations
-// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
-// And that may invoke error in definition flow:
-// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
-defineProperty(
- HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
- d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])
-);
diff --git a/system/websocket_test/node_modules/es6-symbol/validate-symbol.js b/system/websocket_test/node_modules/es6-symbol/validate-symbol.js
deleted file mode 100644
index bac6f54..0000000
--- a/system/websocket_test/node_modules/es6-symbol/validate-symbol.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-var isSymbol = require("./is-symbol");
-
-module.exports = function (value) {
- if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
- return value;
-};
diff --git a/system/websocket_test/node_modules/esniff/.prettierignore b/system/websocket_test/node_modules/esniff/.prettierignore
deleted file mode 100644
index 17d71f3..0000000
--- a/system/websocket_test/node_modules/esniff/.prettierignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/coverage
-/test/__playground
diff --git a/system/websocket_test/node_modules/esniff/.testignore b/system/websocket_test/node_modules/esniff/.testignore
deleted file mode 100644
index 18d1d20..0000000
--- a/system/websocket_test/node_modules/esniff/.testignore
+++ /dev/null
@@ -1,3 +0,0 @@
-lib/ident-next-pattern.js
-lib/ident-start-pattern.js
-test.js
diff --git a/system/websocket_test/node_modules/esniff/CHANGELOG.md b/system/websocket_test/node_modules/esniff/CHANGELOG.md
deleted file mode 100644
index 6a59ea7..0000000
--- a/system/websocket_test/node_modules/esniff/CHANGELOG.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-### [2.0.1](https://github.com/medikoo/esniff/compare/v2.0.0...v2.0.1) (2024-02-21)
-
-### Bug Fixes
-
-- Fix release of operator char trigger event ([1309a18](https://github.com/medikoo/esniff/commit/1309a187ed9dd82aea9f3b9fc3bd4b986c005fcb))
-
-## [2.0.0](https://github.com/medikoo/esniff/compare/v1.1.3...v2.0.0) (2024-02-19)
-
-### ⚠ BREAKING CHANGES
-
-- Main `esniff` interface changed from `code, trigger, callback` to `code, executor` where executor function is provided with emitter that provides access to internal parsing process
-- Property and variable names resolution now respects ES2015+ language rules instead of ES5
-- Utilties were moved:
- - `ensure-string-literal.js` -> `utils/ensure-string-literal.js`
- - `is-string-literal.js` -> `utils/is-string-literal.js`
- - `is-var-name-valid.js` -> `utils/is-variable-name.js`
-
-### Features
-
-- Replace parser with state machine based event driven variant ([0d9bf17](https://github.com/medikoo/esniff/commit/0d9bf1736c795a06d563ce550b50c8a3d90bf1a7))
-- Support ES2015 template strings syntax ([4016496](https://github.com/medikoo/esniff/commit/401649625c35174380fc5eabf5e77f479f09a46f))
-- Upgrade variable and property name patterns to ES2015+ ([7f2f4ab](https://github.com/medikoo/esniff/commit/7f2f4ab68b04d323a8fe305badac403629992656))
-
-### Maintenance Improvements
-
-- Move basic utils into `utils` directory ([afc6ddf](https://github.com/medikoo/esniff/commit/afc6ddf3e3b0bb3b7c8708370d94dd47dc1bdf03))
-- Refactor `stripComments` to rely on main parser ([6d2dd7f](https://github.com/medikoo/esniff/commit/6d2dd7f916c0d54444df061ff0997481dc253f21))
-- Rely on `type` package instead of `es5-ext` ([2a79744](https://github.com/medikoo/esniff/commit/2a79744dff8c04e8dcccb63f0493c2d1e2e7f414))
-
-### [1.1.3](https://github.com/medikoo/esniff/compare/v1.1.2...v1.1.3) (2024-01-04)
-
-### Maintenance Improvements
-
-- Improve `isVarNameValid` internals ([82138c2](https://github.com/medikoo/esniff/commit/82138c2b932debcfe6c5ab6db139889b5ff3d16c))
-
-### [1.1.2](https://github.com/medikoo/esniff/compare/v1.1.1...v1.1.2) (2024-01-04)
-
-### Maintenance Improvements
-
-- Configure `.npmignore` ([1a67292](https://github.com/medikoo/esniff/commit/1a672927bf1367e335080e1dae312bb1fb6b79b1))
-
-### [1.1.1](https://github.com/medikoo/esniff/compare/v1.1.0...v1.1.1) (2024-01-04)
-
-### Bug Fixes
-
-- Ensure to detect Windows EOL (`\r\n`) as single EOL ([72a17fe](https://github.com/medikoo/esniff/commit/72a17feed836432ef55864500b52853adf0ab9c3))
-- Fix column indexing in move function ([3c0a6cb](https://github.com/medikoo/esniff/commit/3c0a6cbd5f0955b2728595e55fdb7f4fc3703a95))
-
-### Maintenance Improvements
-
-- Declare support for Node.js v0.10+ ([1eba1d6](https://github.com/medikoo/esniff/commit/1eba1d633b4850b4356aa56d17e80ce6d6e4fae4))
-- ESLint suggested improvements ([d7c65ef](https://github.com/medikoo/esniff/commit/d7c65ef71089cbc2cc83c8e7ae768252c5adb839))
-- Extract regular expression patterns into modules ([1b12cbe](https://github.com/medikoo/esniff/commit/1b12cbe08561fac17774ca77e8c05669774c6e1f))
-- Fix reference links in source code comments ([4787424](https://github.com/medikoo/esniff/commit/47874241eea6740edb0419e4372aa1aed1128a2c))
-- Replace `xlint` configuration with `eslint` ([f434553](https://github.com/medikoo/esniff/commit/f434553f5b997c3e01b72f7692d030df8bbf92c1))
-- Switch LICENSE from MIT to ISC ([cc33510](https://github.com/medikoo/esniff/commit/cc3351055c7b0ca34adc92922ca3321a5ebc85e5))
-
-## Changelog for previous versions
-
-See `CHANGES` file
diff --git a/system/websocket_test/node_modules/esniff/CHANGES b/system/websocket_test/node_modules/esniff/CHANGES
deleted file mode 100644
index 0754cbf..0000000
--- a/system/websocket_test/node_modules/esniff/CHANGES
+++ /dev/null
@@ -1,38 +0,0 @@
-For recent changelog see CHANGELOG.md
-
------
-
-v1.1.0 -- 2016.08.12
-* Add isVarNameValid utility
-
-v1.0.0 -- 2015.09.03
-* Support methods in function resolver
-* Allow operator chars as triggers
-* `resolveSeparated` utility
-* `resolveArguments` utility
-* `isStringLiteral` utility
-* `ensureStringLiteral` utility
-* `stripComments` utility
-* `resolveConcat` utility
-* Fix bug in multiline comments handling
-* Optimise and improve internal algorithms
-* Simplify internal algorithm with cost of invalid `{} /regexp/` handling
-* Improve arguments validation
-* Reorganise private modules into lib folder
-* Improve tests
-* Fix spelling of LICENSE
-* Update Travis CI configuration
-
-v0.1.1 -- 2014.08.08
-* Fix support for one character named functions in `function` utility.
- Thanks @kamsi for picking this up
-* Add lint configuration
-* Update dependencies configuration
-
-v0.1.0 -- 2014.04.28
-* Assure strictly npm hosted dependencies
-* Add accessedProperties resolver
-* Expose whitespace maps as individual modules
-
-v0.0.0 -- 2013.11.06
-Initial (dev version)
diff --git a/system/websocket_test/node_modules/esniff/LICENSE b/system/websocket_test/node_modules/esniff/LICENSE
deleted file mode 100644
index 38d8a75..0000000
--- a/system/websocket_test/node_modules/esniff/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2013-2024, Mariusz Nowak, @medikoo, medikoo.com
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/system/websocket_test/node_modules/esniff/README.md b/system/websocket_test/node_modules/esniff/README.md
deleted file mode 100644
index d75800c..0000000
--- a/system/websocket_test/node_modules/esniff/README.md
+++ /dev/null
@@ -1,130 +0,0 @@
-[![Build status][build-image]][build-url]
-[![Tests coverage][cov-image]][cov-url]
-[![npm version][npm-image]][npm-url]
-
-# esniff
-
-## Low footprint JavaScript source code parser
-
-Low footprint, fast source code parser, which allows you to find all code fragment occurrences with respect to all syntax rules that cannot be handled with plain regular expression search.
-
-It aims at use cases where we don't need full AST tree, but instead we're interested in finding usages of given function, property etc. in syntactically valid code.
-
-### Installation
-
-#### npm
-
- $ npm install esniff
-
-### Usage
-
-Using main module you can configure sophisticated parser on your own. However, first, **see preprared [API utilities](#API) that may already address use cases you have**.
-
-#### esniff(code, executor)
-
-- `code` - Code to parse
-- `executor` - A function to be executed immediately by the constructor, It receives an `emitter` parameter.
-
-`emitter` emits following events:
-
-- `trigger:` - When char is a code character approached in code, that is not a whitespaces, is not in a middle of identificator, is not part of a comment, string, template string or regular expression.
-
-Emitter passes to listener and `accessor` object, which provides access to current parser state and allows to manipulate parsing process. `accessor` exposes following methods:
-
-- `skipCodePart(codePart)` - Skips forward through input _codePart_ assuming parser index points start of given part. Returns true if given `codePart` was found and index and skipped
-- `skipIdentifier` - Skips approached identifier (can be function name or property name), returns `{ name, start, end }` meta object
-- `skipWhitespace` - Skips any whitespace and comments founds at current parsing index
-- `collectScope` - If at current index `(` character is found, it registers given paranthesis scope for registrations (it's content will be returned as one of the results after finished parsing)
-- `stop` - Stops parsing process
-- `index` - Returns currently parsed index
-- `previousToken` - Previous non-whitespace character
-- `scopeDepth` - Current scope depth
-- `shouldCollectComments` - Whether data about code comments should be collected in the result
-
-##### Example
-
-Parse all `require(..)` calls:
-
-```javascript
-var esniff = require("esniff");
-
-var parseRequires = function (code) {
- return esniff(code, function (emitter) {
- emitter.on("trigger:r", function (accessor) {
- if (accessor.previousToken === ".") return;
- if (!accessor.skipCodePart("require")) return;
- accessor.skipWhitespace();
- accessor.collectScope();
- });
- });
-};
-
-console.log(parseRequires("var x = require('foo/bar')"));
-[{ type: "scope", point: 17, column: 17, line: 1, raw: "'foo/bar'" }];
-```
-
-#### Predefined utils for common use cases
-
-#### accessedProperties(objName) _(esniff/accessed-properties)_
-
-Returns function which allows us to find all accessed property names on given object name
-
-```javascript
-var findProperties = require("esniff/accessed-properties");
-var findContextProperties = findProperties("this");
-
-var result = findContextProperties(
- "var foo = \"0\"; this.bar = foo; this.someMethod(); otherFunction()"
-);
-console.log(result); // [ { name: 'bar', start: 20, end: 23 }, { name: 'someMethod', start: 36, end: 46 } ]
-```
-
-#### function(name[, options]) _(esniff/function)_
-
-Returns function which allows us to find all occurrences of given function (or method) being invoked
-
-Through options we can restrict cases which we're after:
-
-- `asProperty` (default: `false`), on true will allow `x.name()` when we search for `name` calls
-- `asPlain` (default: `true`), on true it allows plain calls e.g. `name()` when we search for `name`. Should be set to `false` if we're strictly about method calls.
-
-Setting both `asProperty` and `asPlain` to false, will always produce empty result
-
-```javascript
-var findRequires = require("esniff/function")("require");
-
-findRequires("var x = require('foo/bar')");
-// [{ point: 17, column: 17, line: 1, raw: '\'foo/bar\'' }]
-```
-
-#### resolveArguments(code[, limit]) _(esniff/resolve-arguments)_
-
-Resolves expressions separated with commas, with additional `limit` you can specify after which number of arguments resolver should stop
-
-```javascript
-var resolveArgs = require("esniff/resolve-arguments");
-
-var result = resolveArgs("'raz', 'dwa', ['raz', 'dwa'], 'trzy'", 3);
-
-console.log(result); // ['"raz"', ' "dwa"', ' [\'raz\', \'dwa\']']
-```
-
-### Limitations
-
-- _esniff_ assumes code that you pass is syntactically correct, it won't inform you about any syntax errors and may produce unexpected and nonsense results when such code is used.
-- There's single case of syntactically correct code, which will make _esniff_ produce incorrect results, it's division made directly on object literal (e.g. `x = { foo: 'bar' } / 14`, esniff in that case will assume that `/` starts regular expression). Still there's not known use case where such code may make any sense, and many popular JS source code parsers share very same vulnerability.
-
-## Tests
-
- $ npm test
-
-## Security contact information
-
-To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
-
-[build-image]: https://github.com/medikoo/esniff/workflows/Integrate/badge.svg
-[build-url]: https://github.com/medikoo/esniff/actions?query=workflow%3AIntegrate
-[cov-image]: https://img.shields.io/codecov/c/github/medikoo/esniff.svg
-[cov-url]: https://codecov.io/gh/medikoo/esniff
-[npm-image]: https://img.shields.io/npm/v/esniff.svg
-[npm-url]: https://www.npmjs.com/package/esniff
diff --git a/system/websocket_test/node_modules/esniff/accessed-properties.js b/system/websocket_test/node_modules/esniff/accessed-properties.js
deleted file mode 100644
index eb66855..0000000
--- a/system/websocket_test/node_modules/esniff/accessed-properties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure")
- , esniff = require("./");
-
-module.exports = function (objName) {
- var length;
- objName = ensureString(objName);
- length = objName.length;
- if (!length) throw new TypeError(objName + " is not valid object name");
- return function (code) {
- var data = [];
- code = ensureString(code);
- esniff(code, function (emitter) {
- emitter.on("trigger:" + objName[0], function (accessor) {
- if (accessor.previousToken === ".") return;
- if (!accessor.skipCodePart(objName)) return;
- accessor.skipWhitespace();
- if (!accessor.skipCodePart(".")) return;
- accessor.skipWhitespace();
- var identifierMeta = accessor.skipIdentifier();
- if (identifierMeta) data.push(identifierMeta);
- });
- });
- return data;
- };
-};
diff --git a/system/websocket_test/node_modules/esniff/function.js b/system/websocket_test/node_modules/esniff/function.js
deleted file mode 100644
index 8ae78bd..0000000
--- a/system/websocket_test/node_modules/esniff/function.js
+++ /dev/null
@@ -1,40 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure")
- , isValue = require("type/value/is")
- , esniff = require("./");
-
-module.exports = function (name/*, options*/) {
- var options = Object(arguments[1])
- , asProperty = options.asProperty
- , asPlain = isValue(options.asPlain) ? options.asPlain : true;
- var length, names;
- name = ensureString(name);
- names = name.split(".").map(function (prop) {
- prop = prop.trim();
- if (!prop) throw new TypeError(name + " is not valid function name");
- return prop;
- });
- length = names.length;
- return function (code) {
- code = ensureString(code);
- return esniff(code, function (emitter) {
- emitter.on("trigger:" + names[0][0], function (accessor) {
- if (accessor.previousToken === ".") {
- if (!asProperty) return;
- } else if (!asPlain) {
- return;
- }
- for (var i = 0, propertyName; (propertyName = names[i]); ++i) {
- if (!accessor.skipCodePart(propertyName)) return;
- accessor.skipWhitespace();
- if (i < length - 1) {
- if (!accessor.skipCodePart(".")) return;
- accessor.skipWhitespace();
- }
- }
- accessor.collectScope();
- });
- });
- };
-};
diff --git a/system/websocket_test/node_modules/esniff/index.js b/system/websocket_test/node_modules/esniff/index.js
deleted file mode 100644
index 0c0a871..0000000
--- a/system/websocket_test/node_modules/esniff/index.js
+++ /dev/null
@@ -1,323 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure")
- , ensurePlainFunction = require("type/plain-function/ensure")
- , from = require("es5-ext/array/from")
- , primitiveSet = require("es5-ext/object/primitive-set")
- , eventEmitter = require("event-emitter")
- , allOff = require("event-emitter/all-off")
- , d = require("d")
- , eolSet = require("./lib/ws-eol")
- , wsSet = require("./lib/ws")
- , identStart = require("./lib/ident-start-pattern")
- , identNext = require("./lib/ident-next-pattern");
-
-var objHasOwnProperty = Object.prototype.hasOwnProperty
- , preRegExpSet = primitiveSet.apply(null, from(";{=([,<>+-*/%&|^!~?:}"))
- , nonNameSet = primitiveSet.apply(null, from(";{=([,<>+-*/%&|^!~?:})].`"))
- , reIdentStart = new RegExp(identStart)
- , reIdentNext = new RegExp(identNext);
-
-var code, index, char, state, columnIndex, line, quote, scopeDepth, templateContext, previousToken
- , followsWhitespace, results, followsSkip, collectedScopeDatum, collectedScopeData
- , collectedScopeDepth, commentDatum, shouldCollectComments;
-
-var handleEol = function () {
- if (char === "\r" && code[index + 1] === "\n") char = code[++index];
- columnIndex = index + 1;
- ++line;
-};
-
-var emitter = eventEmitter();
-var accessor = Object.create(null, {
- skipCodePart: d(function (codePart) {
- var codePartLength = codePart.length;
- for (var i = 0; i < codePartLength; ++i) {
- if (code[index + i] !== codePart[i]) return false;
- }
- index += codePartLength;
- char = code[index];
- previousToken = code[index - 1];
- followsWhitespace = false;
- followsSkip = true;
- return true;
- }),
- skipIdentifier: d(function () {
- if (!reIdentStart.test(char)) return null;
- var startIndex = index;
- var identifier = char;
- while ((char = code[++index]) && reIdentNext.test(char)) identifier += char;
- followsWhitespace = false;
- followsSkip = true;
- previousToken = code[index - 1];
- return { name: identifier, start: startIndex, end: index };
- }),
- skipWhitespace: d(function () {
- while (char) {
- if (objHasOwnProperty.call(wsSet, char)) {
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- } else if (char === "/") {
- if (code[index + 1] === "/") {
- // Single line comment
- if (shouldCollectComments) {
- commentDatum = {
- type: "comment",
- point: index,
- line: line,
- column: index - columnIndex
- };
- }
- index += 2;
- char = code[index];
- while (char) {
- if (objHasOwnProperty.call(eolSet, char)) {
- if (commentDatum) {
- commentDatum.endPoint = index;
- results.push(commentDatum);
- commentDatum = null;
- }
- handleEol();
- break;
- }
- char = code[++index];
- }
- } else if (code[index + 1] === "*") {
- if (shouldCollectComments) {
- commentDatum = {
- type: "comment",
- point: index,
- line: line,
- column: index - columnIndex
- };
- }
- index += 2;
- char = code[index];
- while (char) {
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- if (char === "*" && code[index + 1] === "/") {
- if (commentDatum) {
- commentDatum.endPoint = index + 2;
- results.push(commentDatum);
- commentDatum = null;
- }
- char = code[++index];
- break;
- }
- char = code[++index];
- }
- } else {
- break;
- }
- } else {
- break;
- }
- followsWhitespace = true;
- followsSkip = true;
- char = code[++index];
- }
- }),
- collectScope: d(function () {
- if (char !== "(") return;
- previousToken = char;
- char = code[++index];
- followsSkip = true;
- if (collectedScopeDatum) collectedScopeData.push(collectedScopeDepth, collectedScopeDatum);
- collectedScopeDepth = ++scopeDepth;
- collectedScopeDatum = {
- type: "scope",
- point: index + 1,
- line: line,
- column: index - columnIndex + 1
- };
- }),
- stop: d(function () { state = null; }),
- index: d.gs(function () { return index; }),
- previousToken: d.gs(function () { return previousToken; }),
- scopeDepth: d.gs(function () { return scopeDepth; }),
- shouldCollectComments: d.gs(
- function () { return shouldCollectComments; },
- function (value) { shouldCollectComments = Boolean(value); }
- )
-});
-
-module.exports = function (userCode, executor) {
- code = ensureString(userCode);
- executor = ensurePlainFunction(executor);
- allOff(emitter);
- executor(emitter, accessor);
- index = -1;
- state = "out";
- columnIndex = 0;
- line = 1;
- scopeDepth = 0;
- templateContext = [];
- previousToken = null;
- followsWhitespace = true;
- results = [];
- followsSkip = false;
- collectedScopeDatum = null;
- collectedScopeData = [];
- collectedScopeDepth = null;
-
- stateLoop: while (state) {
- if (followsSkip) followsSkip = false;
- else char = code[++index];
- if (!char) break;
-
- switch (state) {
- case "out":
- if (objHasOwnProperty.call(wsSet, char)) {
- if (objHasOwnProperty.call(eolSet, char)) {
- handleEol();
- }
- followsWhitespace = true;
- continue stateLoop;
- }
- if (char === "/") {
- if (previousToken && objHasOwnProperty.call(preRegExpSet, previousToken)) {
- state = "slashOrRegexp";
- } else {
- state = "slash";
- }
- } else if (char === "'" || char === "\"") {
- state = "string";
- quote = char;
- } else if (char === "`") {
- state = "template";
- } else if (char === "(" || char === "{" || char === "[") {
- ++scopeDepth;
- } else if (char === ")" || char === "}" || char === "]") {
- if (scopeDepth === collectedScopeDepth) {
- collectedScopeDatum.raw = code.slice(collectedScopeDatum.point - 1, index);
- results.push(collectedScopeDatum);
- collectedScopeDatum = collectedScopeData.pop();
- collectedScopeDepth = collectedScopeData.pop();
- }
- --scopeDepth;
- if (char === "}") {
- if (templateContext[templateContext.length - 1] === scopeDepth + 1) {
- templateContext.pop();
- state = "template";
- }
- }
- }
- if (
- !previousToken ||
- followsWhitespace ||
- objHasOwnProperty.call(nonNameSet, previousToken) ||
- objHasOwnProperty.call(nonNameSet, char)
- ) {
- emitter.emit("trigger:" + char, accessor);
- if (followsSkip) continue stateLoop;
- }
- previousToken = char;
- followsWhitespace = false;
- continue stateLoop;
- case "slashOrRegexp":
- case "slash":
- if (char === "/") {
- if (shouldCollectComments) {
- commentDatum = {
- type: "comment",
- point: index - 1,
- line: line,
- column: index - columnIndex - 1
- };
- }
- state = "singleLineComment";
- } else if (char === "*") {
- if (shouldCollectComments) {
- commentDatum = {
- type: "comment",
- point: index - 1,
- line: line,
- column: index - columnIndex - 1
- };
- }
- state = "multiLineComment";
- } else if (objHasOwnProperty.call(eolSet, char)) {
- handleEol();
- followsWhitespace = true;
- state = "out";
- continue stateLoop;
- } else if (state === "slashOrRegexp") {
- state = "regexp";
- } else {
- state = "out";
- continue stateLoop;
- }
- break;
- case "singleLineComment":
- if (objHasOwnProperty.call(eolSet, char)) {
- if (commentDatum) {
- commentDatum.endPoint = index;
- results.push(commentDatum);
- commentDatum = null;
- }
- handleEol();
- followsWhitespace = true;
- state = "out";
- }
- continue stateLoop;
- case "multiLineComment":
- if (char === "*") state = "multiLineCommentStar";
- else if (objHasOwnProperty.call(eolSet, char)) handleEol();
- continue stateLoop;
- case "multiLineCommentStar":
- if (char === "/") {
- followsWhitespace = true;
- state = "out";
- if (commentDatum) {
- commentDatum.endPoint = index + 1;
- results.push(commentDatum);
- commentDatum = null;
- }
- } else if (char !== "*") {
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- state = "multiLineComment";
- }
- continue stateLoop;
- case "string":
- if (char === "\\") state = "stringEscape";
- else if (char === quote) state = "out";
- break;
- case "stringEscape":
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- state = "string";
- break;
- case "template":
- if (char === "$") state = "templateDollar";
- else if (char === "\\") state = "templateEscape";
- else if (char === "`") state = "out";
- else if (objHasOwnProperty.call(eolSet, char)) handleEol();
- break;
- case "templateEscape":
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- state = "template";
- break;
- case "templateDollar":
- if (char === "{") {
- templateContext.push(++scopeDepth);
- state = "out";
- } else if (char !== "$") {
- if (objHasOwnProperty.call(eolSet, char)) handleEol();
- state = "template";
- }
- break;
- case "regexp":
- if (char === "\\") state = "regexpEscape";
- else if (char === "/") state = "out";
- break;
- case "regexpEscape":
- state = "regexp";
- break;
- /* istanbul ignore next */
- default:
- throw new Error("Unexpected state " + state);
- }
- previousToken = null;
- followsWhitespace = false;
- }
-
- return results;
-};
diff --git a/system/websocket_test/node_modules/esniff/lib/ident-next-pattern.js b/system/websocket_test/node_modules/esniff/lib/ident-next-pattern.js
deleted file mode 100644
index b217781..0000000
--- a/system/websocket_test/node_modules/esniff/lib/ident-next-pattern.js
+++ /dev/null
@@ -1,98 +0,0 @@
-"use strict";
-
-// Stolen from excellent work by Mathias Bynens, see:
-// http://mathiasbynens.be/notes/javascript-properties
-// https://github.com/mathiasbynens/mothereff.in/blob/9cd5ec4649db25ae675aec25f428f3ddf3d9a087/js-properties/eff.js#L79
-
-module.exports =
- "[\\$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC" +
- "\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1" +
- "\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587" +
- "\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A" +
- "\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A" +
- "\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963" +
- "\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2" +
- "\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3" +
- "\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33" +
- "\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C" +
- "\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2" +
- "\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF" +
- "\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39" +
- "\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F" +
- "\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F" +
- "\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7" +
- "\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39" +
- "\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F" +
- "\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9" +
- "\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1" +
- "\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48" +
- "\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96" +
- "\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF" +
- "\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87" +
- "\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB" +
- "\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00" +
- "\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84" +
- "\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD" +
- "\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288" +
- "\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6" +
- "\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F" +
- "\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8" +
- "\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773" +
- "\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877" +
- "\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D" +
- "\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E" +
- "\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59" +
- "\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2" +
- "\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D" +
- "\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4" +
- "\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D" +
- "\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107" +
- "\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149" +
- "\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27" +
- "\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE" +
- "\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007" +
- "\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA" +
- "\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5" +
- "\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F" +
- "\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E" +
- "\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7" +
- "\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE" +
- "\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD" +
- "\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26" +
- "\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9" +
- "\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06" +
- "\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44" +
- "\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F" +
- "\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A" +
- "\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|" +
- "\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D" +
- "\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A" +
- "\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D" +
- "\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802" +
- "[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E" +
- "\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13" +
- "\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7" +
- "\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|" +
- "\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34" +
- "\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37" +
- "\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30" +
- "\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63" +
- "\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5" +
- "\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806" +
- "[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C" +
- "\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38" +
- "\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43" +
- "\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|" +
- "\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D" +
- "\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD" +
- "\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6" +
- "\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14" +
- "\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5" +
- "\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E" +
- "\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A" +
- "[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27" +
- "\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52" +
- "\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72" +
- "\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9" +
- "\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E" +
- "[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]";
diff --git a/system/websocket_test/node_modules/esniff/lib/ident-start-pattern.js b/system/websocket_test/node_modules/esniff/lib/ident-start-pattern.js
deleted file mode 100644
index 77dde64..0000000
--- a/system/websocket_test/node_modules/esniff/lib/ident-start-pattern.js
+++ /dev/null
@@ -1,83 +0,0 @@
-"use strict";
-
-// Stolen from excellent work by Mathias Bynens, see:
-// http://mathiasbynens.be/notes/javascript-properties
-// https://github.com/mathiasbynens/mothereff.in/blob/9cd5ec4649db25ae675aec25f428f3ddf3d9a087/js-properties/eff.js#L79
-
-module.exports =
- "[\\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE" +
- "\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1" +
- "\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA" +
- "\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF" +
- "\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA" +
- "\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950" +
- "\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2" +
- "\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10" +
- "\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E" +
- "\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9" +
- "\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33" +
- "\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90" +
- "\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0" +
- "\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61" +
- "\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1" +
- "\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F" +
- "\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33" +
- "\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F" +
- "\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6" +
- "\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055" +
- "\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD" +
- "\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288" +
- "\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6" +
- "\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C" +
- "\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711" +
- "\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877" +
- "\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB" +
- "\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE" +
- "\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5" +
- "\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59" +
- "\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC" +
- "\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C" +
- "\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F" +
- "\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2" +
- "\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE" +
- "\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE" +
- "\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F" +
- "\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF" +
- "\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B" +
- "\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E" +
- "\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873" +
- "\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF" +
- "\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B" +
- "\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD" +
- "\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26" +
- "\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6" +
- "\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28" +
- "\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D" +
- "\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A" +
- "\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800" +
- "[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D" +
- "\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A" +
- "\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D" +
- "\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05" +
- "\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15" +
- "\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33" +
- "\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55" +
- "\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF" +
- "\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11" +
- "\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33" +
- "\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE" +
- "\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808" +
- "[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|" +
- "\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F" +
- "\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C" +
- "[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835" +
- "[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB" +
- "\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39" +
- "\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA" +
- "\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88" +
- "\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03" +
- "\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47" +
- "\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62" +
- "\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B" +
- "\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D" +
- "[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]";
diff --git a/system/websocket_test/node_modules/esniff/lib/ws-eol.js b/system/websocket_test/node_modules/esniff/lib/ws-eol.js
deleted file mode 100644
index 10e5cc8..0000000
--- a/system/websocket_test/node_modules/esniff/lib/ws-eol.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-
-var from = require("es5-ext/array/from")
- , primitiveSet = require("es5-ext/object/primitive-set");
-
-module.exports = primitiveSet.apply(null, from("\n\r\u2028\u2029"));
diff --git a/system/websocket_test/node_modules/esniff/lib/ws-inline.js b/system/websocket_test/node_modules/esniff/lib/ws-inline.js
deleted file mode 100644
index 0617bba..0000000
--- a/system/websocket_test/node_modules/esniff/lib/ws-inline.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var from = require("es5-ext/array/from")
- , primitiveSet = require("es5-ext/object/primitive-set");
-
-module.exports = primitiveSet.apply(
- null,
- from(
- " \f\t\v\u00a0\u1680\u180e" +
- "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a" +
- "\u202f\u205f\u3000"
- )
-);
diff --git a/system/websocket_test/node_modules/esniff/lib/ws.js b/system/websocket_test/node_modules/esniff/lib/ws.js
deleted file mode 100644
index c2ea6fd..0000000
--- a/system/websocket_test/node_modules/esniff/lib/ws.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-var primitiveSet = require("es5-ext/object/primitive-set")
- , eol = require("./ws-eol")
- , inline = require("./ws-inline");
-
-module.exports = primitiveSet.apply(null, Object.keys(eol).concat(Object.keys(inline)));
diff --git a/system/websocket_test/node_modules/esniff/package.json b/system/websocket_test/node_modules/esniff/package.json
deleted file mode 100644
index 2c75a68..0000000
--- a/system/websocket_test/node_modules/esniff/package.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "name": "esniff",
- "version": "2.0.1",
- "description": "Low footprint ECMAScript source code parser",
- "author": "Mariusz Nowak (http://www.medikoo.com/)",
- "keywords": [
- "sniff",
- "analyze",
- "ast",
- "parse",
- "syntax",
- "sniffer",
- "detective",
- "detect",
- "find",
- "search",
- "source",
- "code"
- ],
- "repository": "medikoo/esniff",
- "dependencies": {
- "d": "^1.0.1",
- "es5-ext": "^0.10.62",
- "event-emitter": "^0.3.5",
- "type": "^2.7.2"
- },
- "devDependencies": {
- "eslint": "^8.56.0",
- "eslint-config-medikoo": "^4.2.0",
- "esprima": "^4.0.1",
- "github-release-from-cc-changelog": "^2.3.0",
- "nyc": "^15.1.0",
- "prettier-elastic": "^2.7.1",
- "tad": "^3.1.1"
- },
- "eslintConfig": {
- "extends": "medikoo/es5",
- "root": true,
- "overrides": [
- {
- "files": [
- "index.js"
- ],
- "rules": {
- "max-depth": "off"
- }
- },
- {
- "files": [
- "index.js",
- "utils/is-variable-name.js"
- ],
- "rules": {
- "max-lines": "off"
- }
- },
- {
- "files": [
- "utils/is-variable-name.js"
- ],
- "rules": {
- "no-misleading-character-class": "off"
- }
- },
- {
- "files": [
- "test/**"
- ],
- "env": {
- "node": true
- }
- }
- ]
- },
- "eslintIgnore": [
- "/coverage",
- "/test/__playground"
- ],
- "prettier": {
- "printWidth": 100,
- "tabWidth": 4,
- "overrides": [
- {
- "files": [
- "*.md",
- "*.yml"
- ],
- "options": {
- "tabWidth": 2
- }
- }
- ]
- },
- "nyc": {
- "all": true,
- "exclude": [
- ".github",
- "coverage/**",
- "test/**",
- "*.config.js"
- ],
- "reporter": [
- "lcov",
- "html",
- "text-summary"
- ]
- },
- "scripts": {
- "coverage": "nyc npm test",
- "lint": "eslint .",
- "lint:updated": "pipe-git-updated --base=main --ext=js -- eslint --ignore-pattern '!*'",
- "prettier-check": "prettier -c \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettier-check:updated": "pipe-git-updated --base=main --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
- "prettify": "prettier --write \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettify:updated": "pipe-git-updated ---base=main -ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
- "test": "node ./node_modules/tad/bin/tad"
- },
- "engines": {
- "node": ">=0.10"
- },
- "license": "ISC"
-}
diff --git a/system/websocket_test/node_modules/esniff/resolve-arguments.js b/system/websocket_test/node_modules/esniff/resolve-arguments.js
deleted file mode 100644
index 52ebb7c..0000000
--- a/system/websocket_test/node_modules/esniff/resolve-arguments.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var resolveSeparated = require("./resolve-separated");
-
-module.exports = function (code/*, limit*/) { return resolveSeparated(code, ",", arguments[1]); };
diff --git a/system/websocket_test/node_modules/esniff/resolve-concat.js b/system/websocket_test/node_modules/esniff/resolve-concat.js
deleted file mode 100644
index 7546db1..0000000
--- a/system/websocket_test/node_modules/esniff/resolve-concat.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var resolveSeparated = require("./resolve-separated");
-
-module.exports = function (code/*, limit*/) { return resolveSeparated(code, "+", arguments[1]); };
diff --git a/system/websocket_test/node_modules/esniff/resolve-separated.js b/system/websocket_test/node_modules/esniff/resolve-separated.js
deleted file mode 100644
index e31f64e..0000000
--- a/system/websocket_test/node_modules/esniff/resolve-separated.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var from = require("es5-ext/array/from")
- , ensureString = require("type/string/ensure")
- , primitiveSet = require("es5-ext/object/primitive-set")
- , esniff = require("./");
-
-var allowedSeparators = primitiveSet.apply(null, from(".+-*/,&|;"));
-
-module.exports = function (code, sep/*, limit*/) {
- var expressions, fromIndex, limit = arguments[2] || Infinity;
- code = ensureString(code);
- sep = ensureString(sep);
- if (!allowedSeparators[sep]) throw new Error(sep + " is not supported separator");
- expressions = [];
- fromIndex = 0;
- esniff(code, function (emitter) {
- emitter.on("trigger:" + sep, function (accessor) {
- if (accessor.scopeDepth !== 0) return;
- var index = accessor.index;
- if (expressions.push(code.slice(fromIndex, index)) === limit) accessor.stop();
- fromIndex = index + 1;
- });
- });
- if (expressions.length < limit) expressions.push(code.slice(fromIndex));
- return expressions;
-};
diff --git a/system/websocket_test/node_modules/esniff/strip-comments.js b/system/websocket_test/node_modules/esniff/strip-comments.js
deleted file mode 100644
index efdda51..0000000
--- a/system/websocket_test/node_modules/esniff/strip-comments.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-
-var repeat = require("es5-ext/string/#/repeat")
- , esniff = require("./");
-
-module.exports = exports = function (code/*, options*/) {
- var options = Object(arguments[1]);
-
- var comments = esniff(code, function (emitter, accessor) {
- accessor.shouldCollectComments = true;
- });
-
- if (!comments.length) return code;
- var i = 0, result = [];
- comments.forEach(function (commentMeta) {
- result.push(code.slice(i, commentMeta.point));
- if (options.preserveLocation) {
- result.push(repeat.call(" ", commentMeta.endPoint - commentMeta.point));
- }
- i = commentMeta.endPoint;
- });
- result.push(code.slice(i));
- return result.join("");
-};
diff --git a/system/websocket_test/node_modules/esniff/utils/ensure-string-literal.js b/system/websocket_test/node_modules/esniff/utils/ensure-string-literal.js
deleted file mode 100644
index d2e6d52..0000000
--- a/system/websocket_test/node_modules/esniff/utils/ensure-string-literal.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-var isStringLiteral = require("./is-string-literal");
-
-module.exports = function (arg) {
- if (isStringLiteral(arg)) return arg;
- throw new TypeError(arg + " does not represent string literal");
-};
diff --git a/system/websocket_test/node_modules/esniff/utils/is-string-literal.js b/system/websocket_test/node_modules/esniff/utils/is-string-literal.js
deleted file mode 100644
index 034e633..0000000
--- a/system/websocket_test/node_modules/esniff/utils/is-string-literal.js
+++ /dev/null
@@ -1,18 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure");
-
-module.exports = function (str) {
- var quote, i, char;
- str = ensureString(str);
- quote = str[0];
- if (quote !== "'" && quote !== "\"") return false;
- i = 0;
- char = str[++i];
- while (char) {
- if (char === quote) break;
- if (char === "\\") ++i;
- char = str[++i];
- }
- return Boolean(char && !str[i + 1]);
-};
diff --git a/system/websocket_test/node_modules/esniff/utils/is-variable-name.js b/system/websocket_test/node_modules/esniff/utils/is-variable-name.js
deleted file mode 100644
index 2845c04..0000000
--- a/system/websocket_test/node_modules/esniff/utils/is-variable-name.js
+++ /dev/null
@@ -1,216 +0,0 @@
-// Credit: Mathias Bynens -> https://mathiasbynens.be/demo/javascript-identifier-regex
-
-"use strict";
-
-// https://github.com/mathiasbynens/mothereff.in/blob/9cd5ec4649db25ae675aec25f428f3ddf3d9a087/js-variables/eff.js#L83
-var isES6ReservedWord = RegExp.prototype.test.bind(
- new RegExp(
- "^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|" +
- "with|await|break|catch|class|const|super|throw|while|yield|delete|export|import|" +
- "public|return|static|switch|typeof|default|extends|finally|package|private|" +
- "continue|debugger|function|arguments|interface|protected|implements|instanceof)$"
- )
-);
-
-// https://github.com/mathiasbynens/mothereff.in/blob/9cd5ec4649db25ae675aec25f428f3ddf3d9a087/js-variables/eff.js#L78
-var isES6Identifier = RegExp.prototype.test.bind(
- new RegExp(
- "^(?:[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1" +
- "\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386" +
- "\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F" +
- "\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E" +
- "\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710" +
- "\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A" +
- "\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961" +
- "\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2" +
- "\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F" +
- "\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C" +
- "\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2" +
- "\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10" +
- "\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61" +
- "\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F" +
- "\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10" +
- "\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C" +
- "\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1" +
- "\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61" +
- "\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6" +
- "\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D" +
- "\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2" +
- "\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C" +
- "\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066" +
- "\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA" +
- "\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288" +
- "\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5" +
- "\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5" +
- "\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8" +
- "\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770" +
- "\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5" +
- "\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16" +
- "\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF" +
- "\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1" +
- "\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D" +
- "\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE" +
- "\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4" +
- "\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D" +
- "\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188" +
- "\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25" +
- "\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE" +
- "\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE" +
- "\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F" +
- "\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF" +
- "\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F" +
- "\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788" +
- "\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822" +
- "\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946" +
- "\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE" +
- "\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1" +
- "\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4" +
- "\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A" +
- "\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D" +
- "\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36" +
- "\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F" +
- "\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A" +
- "\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800" +
- "[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D" +
- "\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A" +
- "\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801" +
- "[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|" +
- "\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55" +
- "\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39" +
- "\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33" +
- "\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55" +
- "\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804" +
- "[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76" +
- "\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86" +
- "\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F" +
- "\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50" +
- "\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB" +
- "\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF" +
- "\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C" +
- "\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|" +
- "\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F" +
- "\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|" +
- "\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|" +
- "\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC" +
- "\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14" +
- "\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50" +
- "\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34" +
- "\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|" +
- "\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27" +
- "\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51" +
- "\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A" +
- "\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B" +
- "\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D" +
- "[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873" +
- "[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D])(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6" +
- "\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376" +
- "\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5" +
- "\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587" +
- "\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2" +
- "\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC" +
- "\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B" +
- "\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990" +
- "\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8" +
- "\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03" +
- "\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38" +
- "\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E" +
- "\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0" +
- "\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0" +
- "\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10" +
- "\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48" +
- "\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83" +
- "\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4" +
- "\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7" +
- "\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39" +
- "\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63" +
- "\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3" +
- "\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE" +
- "\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10" +
- "\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63" +
- "\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB" +
- "\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3" +
- "\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D" +
- "\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9" +
- "\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00" +
- "\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84" +
- "\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7" +
- "\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D" +
- "\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0" +
- "\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F" +
- "\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F" +
- "\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734" +
- "\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD" +
- "\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5" +
- "\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB" +
- "\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89" +
- "\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73" +
- "\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6" +
- "\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D" +
- "\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE" +
- "\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4" +
- "\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC" +
- "\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128" +
- "\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E" +
- "\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67" +
- "\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE" +
- "\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007" +
- "\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA" +
- "\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5" +
- "\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F" +
- "\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7" +
- "\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD" +
- "\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE" +
- "\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD" +
- "\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26" +
- "\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9" +
- "\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06" +
- "\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44" +
- "\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F" +
- "\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19" +
- "\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF" +
- "\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C" +
- "\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C" +
- "\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D" +
- "\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9" +
- "\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802" +
- "[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76" +
- "\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7" +
- "\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33" +
- "\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6" +
- "\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48" +
- "\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA" +
- "\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76" +
- "\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37" +
- "\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA" +
- "\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30" +
- "\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57" +
- "\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9" +
- "\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59" +
- "\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806" +
- "[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E" +
- "\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|" +
- "\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E" +
- "\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59" +
- "\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C" +
- "[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D" +
- "\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD" +
- "\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6" +
- "\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A" +
- "\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46" +
- "\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14" +
- "\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2" +
- "\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84" +
- "\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B" +
- "[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37" +
- "\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59" +
- "\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77" +
- "\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9" +
- "\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34" +
- "\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E" +
- "[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])*$"
- )
-);
-
-module.exports = function (varName) {
- return isES6Identifier(varName) && !isES6ReservedWord(varName);
-};
diff --git a/system/websocket_test/node_modules/event-emitter/.lint b/system/websocket_test/node_modules/event-emitter/.lint
deleted file mode 100644
index f76e528..0000000
--- a/system/websocket_test/node_modules/event-emitter/.lint
+++ /dev/null
@@ -1,15 +0,0 @@
-@root
-
-module
-es5
-
-indent 2
-maxlen 80
-tabs
-
-ass
-plusplus
-nomen
-
-./benchmark
-predef+ console
diff --git a/system/websocket_test/node_modules/event-emitter/.npmignore b/system/websocket_test/node_modules/event-emitter/.npmignore
deleted file mode 100644
index 68ebfdd..0000000
--- a/system/websocket_test/node_modules/event-emitter/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-/.lintcache
-/node_modules
diff --git a/system/websocket_test/node_modules/event-emitter/.testignore b/system/websocket_test/node_modules/event-emitter/.testignore
deleted file mode 100644
index f9c8c38..0000000
--- a/system/websocket_test/node_modules/event-emitter/.testignore
+++ /dev/null
@@ -1 +0,0 @@
-/benchmark
diff --git a/system/websocket_test/node_modules/event-emitter/.travis.yml b/system/websocket_test/node_modules/event-emitter/.travis.yml
deleted file mode 100644
index 5f29034..0000000
--- a/system/websocket_test/node_modules/event-emitter/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
-language: node_js
-node_js:
- - 0.12
- - 4
- - 6
- - 7
-
-before_install:
- - mkdir node_modules; ln -s ../ node_modules/event-emitter
-
-notifications:
- email:
- - medikoo+event-emitter@medikoo.com
-
-script: "npm test && npm run lint"
diff --git a/system/websocket_test/node_modules/event-emitter/CHANGES b/system/websocket_test/node_modules/event-emitter/CHANGES
deleted file mode 100644
index 3ac46ce..0000000
--- a/system/websocket_test/node_modules/event-emitter/CHANGES
+++ /dev/null
@@ -1,73 +0,0 @@
-v0.3.5 -- 2017.03.15
-* Improve documentation
-* Update dependencies
-
-v0.3.4 -- 2015.10.02
-* Add `emitError` extension
-
-v0.3.3 -- 2015.01.30
-* Fix reference to module in benchmarks
-
-v0.3.2 -- 2015.01.20
-* Improve documentation
-* Configure lint scripts
-* Fix spelling of LICENSE
-
-v0.3.1 -- 2014.04.25
-* Fix redefinition of emit method in `pipe`
-* Allow custom emit method name in `pipe`
-
-v0.3.0 -- 2014.04.24
-* Move out from lib folder
-* Do not expose all utilities on main module
-* Support objects which do not inherit from Object.prototype
-* Improve arguments validation
-* Improve internals
-* Remove Makefile
-* Improve documentation
-
-v0.2.2 -- 2013.06.05
-* `unify` functionality
-
-v0.2.1 -- 2012.09.21
-* hasListeners module
-* Simplified internal id (improves performance a little), now it starts with
- underscore (hint it's private). Abstracted it to external module to have it
- one place
-* Documentation cleanup
-
-v0.2.0 -- 2012.09.19
-* Trashed poor implementation of v0.1 and came up with something solid
-
-Changes:
-* Improved performance
-* Fixed bugs event-emitter is now cross-prototype safe and not affected by
- unexpected methods attached to Object.prototype
-* Removed support for optional "emitter" argument in `emit` method, it was
- cumbersome to use, and should be solved just with event objects
-
-v0.1.5 -- 2012.08.06
-* (maintanance) Do not use descriptors for internal objects, it exposes V8 bugs
- (only Node v0.6 branch)
-
-v0.1.4 -- 2012.06.13
-* Fix detachment of listeners added with 'once'
-
-v0.1.3 -- 2012.05.28
-* Updated es5-ext to latest version (v0.8)
-* Cleared package.json so it's in npm friendly format
-
-v0.1.2 -- 2012.01.22
-* Support for emitter argument in emit function, this allows some listeners not
- to be notified about event
-* allOff - removes all listeners from object
-* All methods returns self object
-* Internal fixes
-* Travis CI integration
-
-v0.1.1 -- 2011.08.08
-* Added TAD test suite to devDependencies, configured test commands.
- Tests can be run with 'make test' or 'npm test'
-
-v0.1.0 -- 2011.08.08
-Initial version
diff --git a/system/websocket_test/node_modules/event-emitter/LICENSE b/system/websocket_test/node_modules/event-emitter/LICENSE
deleted file mode 100644
index ccb76f6..0000000
--- a/system/websocket_test/node_modules/event-emitter/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/system/websocket_test/node_modules/event-emitter/README.md b/system/websocket_test/node_modules/event-emitter/README.md
deleted file mode 100644
index 0499054..0000000
--- a/system/websocket_test/node_modules/event-emitter/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-# event-emitter
-## Environment agnostic event emitter
-
-### Installation
-
- $ npm install event-emitter
-
-To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
-
-### Usage
-
-```javascript
-var ee = require('event-emitter');
-
-var MyClass = function () { /* .. */ };
-ee(MyClass.prototype); // All instances of MyClass will expose event-emitter interface
-
-var emitter = new MyClass(), listener;
-
-emitter.on('test', listener = function (args) {
- // … react to 'test' event
-});
-
-emitter.once('test', function (args) {
- // … react to first 'test' event (invoked only once!)
-});
-
-emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked
-emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked
-
-emitter.off('test', listener); // Removed first listener
-emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked
-```
-### Additional utilities
-
-#### allOff(obj) _(event-emitter/all-off)_
-
-Removes all listeners from given event emitter object
-
-#### hasListeners(obj[, name]) _(event-emitter/has-listeners)_
-
-Whether object has some listeners attached to the object.
-When `name` is provided, it checks listeners for specific event name
-
-```javascript
-var emitter = ee();
-var hasListeners = require('event-emitter/has-listeners');
-var listener = function () {};
-
-hasListeners(emitter); // false
-
-emitter.on('foo', listener);
-hasListeners(emitter); // true
-hasListeners(emitter, 'foo'); // true
-hasListeners(emitter, 'bar'); // false
-
-emitter.off('foo', listener);
-hasListeners(emitter, 'foo'); // false
-```
-
-#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_
-
-Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way).
-Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_.
-It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument.
-
-#### unify(emitter1, emitter2) _(event-emitter/unify)_
-
-Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitted on _emitter2_, and other way back.
-Non reversible.
-
-```javascript
-var eeUnify = require('event-emitter/unify');
-
-var emitter1 = ee(), listener1, listener3;
-var emitter2 = ee(), listener2, listener4;
-
-emitter1.on('test', listener1 = function () { });
-emitter2.on('test', listener2 = function () { });
-
-emitter1.emit('test'); // Invoked listener1
-emitter2.emit('test'); // Invoked listener2
-
-var unify = eeUnify(emitter1, emitter2);
-
-emitter1.emit('test'); // Invoked listener1 and listener2
-emitter2.emit('test'); // Invoked listener1 and listener2
-
-emitter1.on('test', listener3 = function () { });
-emitter2.on('test', listener4 = function () { });
-
-emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4
-emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4
-```
-
-### Tests [](https://travis-ci.org/medikoo/event-emitter)
-
- $ npm test
diff --git a/system/websocket_test/node_modules/event-emitter/all-off.js b/system/websocket_test/node_modules/event-emitter/all-off.js
deleted file mode 100644
index 829be65..0000000
--- a/system/websocket_test/node_modules/event-emitter/all-off.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-var value = require('es5-ext/object/valid-object')
-
- , hasOwnProperty = Object.prototype.hasOwnProperty;
-
-module.exports = function (emitter/*, type*/) {
- var type = arguments[1], data;
-
- value(emitter);
-
- if (type !== undefined) {
- data = hasOwnProperty.call(emitter, '__ee__') && emitter.__ee__;
- if (!data) return;
- if (data[type]) delete data[type];
- return;
- }
- if (hasOwnProperty.call(emitter, '__ee__')) delete emitter.__ee__;
-};
diff --git a/system/websocket_test/node_modules/event-emitter/benchmark/many-on.js b/system/websocket_test/node_modules/event-emitter/benchmark/many-on.js
deleted file mode 100644
index e09bfde..0000000
--- a/system/websocket_test/node_modules/event-emitter/benchmark/many-on.js
+++ /dev/null
@@ -1,83 +0,0 @@
-'use strict';
-
-// Benchmark comparing performance of event emit for many listeners
-// To run it, do following in memoizee package path:
-//
-// $ npm install eventemitter2 signals
-// $ node benchmark/many-on.js
-
-var forEach = require('es5-ext/object/for-each')
- , pad = require('es5-ext/string/#/pad')
-
- , now = Date.now
-
- , time, count = 1000000, i, data = {}
- , ee, native, ee2, signals, a = {}, b = {};
-
-ee = (function () {
- var ee = require('../')();
- ee.on('test', function () { return arguments; });
- ee.on('test', function () { return arguments; });
- return ee.on('test', function () { return arguments; });
-}());
-
-native = (function () {
- var ee = require('events');
- ee = new ee.EventEmitter();
- ee.on('test', function () { return arguments; });
- ee.on('test', function () { return arguments; });
- return ee.on('test', function () { return arguments; });
-}());
-
-ee2 = (function () {
- var ee = require('eventemitter2');
- ee = new ee.EventEmitter2();
- ee.on('test', function () { return arguments; });
- ee.on('test', function () { return arguments; });
- return ee.on('test', function () { return arguments; });
-}());
-
-signals = (function () {
- var Signal = require('signals')
- , ee = { test: new Signal() };
- ee.test.add(function () { return arguments; });
- ee.test.add(function () { return arguments; });
- ee.test.add(function () { return arguments; });
- return ee;
-}());
-
-console.log("Emit for 3 listeners", "x" + count + ":\n");
-
-i = count;
-time = now();
-while (i--) {
- ee.emit('test', a, b);
-}
-data["event-emitter (this implementation)"] = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- native.emit('test', a, b);
-}
-data["EventEmitter (Node.js native)"] = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- ee2.emit('test', a, b);
-}
-data.EventEmitter2 = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- signals.test.dispatch(a, b);
-}
-data.Signals = now() - time;
-
-forEach(data, function (value, name, obj, index) {
- console.log(index + 1 + ":", pad.call(value, " ", 5), name);
-}, null, function (a, b) {
- return this[a] - this[b];
-});
diff --git a/system/websocket_test/node_modules/event-emitter/benchmark/single-on.js b/system/websocket_test/node_modules/event-emitter/benchmark/single-on.js
deleted file mode 100644
index 99decbd..0000000
--- a/system/websocket_test/node_modules/event-emitter/benchmark/single-on.js
+++ /dev/null
@@ -1,73 +0,0 @@
-'use strict';
-
-// Benchmark comparing performance of event emit for single listener
-// To run it, do following in memoizee package path:
-//
-// $ npm install eventemitter2 signals
-// $ node benchmark/single-on.js
-
-var forEach = require('es5-ext/object/for-each')
- , pad = require('es5-ext/string/#/pad')
-
- , now = Date.now
-
- , time, count = 1000000, i, data = {}
- , ee, native, ee2, signals, a = {}, b = {};
-
-ee = (function () {
- var ee = require('../');
- return ee().on('test', function () { return arguments; });
-}());
-
-native = (function () {
- var ee = require('events');
- return (new ee.EventEmitter()).on('test', function () { return arguments; });
-}());
-
-ee2 = (function () {
- var ee = require('eventemitter2');
- return (new ee.EventEmitter2()).on('test', function () { return arguments; });
-}());
-
-signals = (function () {
- var Signal = require('signals')
- , ee = { test: new Signal() };
- ee.test.add(function () { return arguments; });
- return ee;
-}());
-
-console.log("Emit for single listener", "x" + count + ":\n");
-
-i = count;
-time = now();
-while (i--) {
- ee.emit('test', a, b);
-}
-data["event-emitter (this implementation)"] = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- native.emit('test', a, b);
-}
-data["EventEmitter (Node.js native)"] = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- ee2.emit('test', a, b);
-}
-data.EventEmitter2 = now() - time;
-
-i = count;
-time = now();
-while (i--) {
- signals.test.dispatch(a, b);
-}
-data.Signals = now() - time;
-
-forEach(data, function (value, name, obj, index) {
- console.log(index + 1 + ":", pad.call(value, " ", 5), name);
-}, null, function (a, b) {
- return this[a] - this[b];
-});
diff --git a/system/websocket_test/node_modules/event-emitter/emit-error.js b/system/websocket_test/node_modules/event-emitter/emit-error.js
deleted file mode 100644
index 769b4c5..0000000
--- a/system/websocket_test/node_modules/event-emitter/emit-error.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-var ensureError = require('es5-ext/error/valid-error')
- , ensureObject = require('es5-ext/object/valid-object')
-
- , hasOwnProperty = Object.prototype.hasOwnProperty;
-
-module.exports = function (err) {
- (ensureObject(this) && ensureError(err));
- if (!hasOwnProperty.call(ensureObject(this), '__ee__')) throw err;
- if (!this.__ee__.error) throw err;
- this.emit('error', err);
-};
diff --git a/system/websocket_test/node_modules/event-emitter/has-listeners.js b/system/websocket_test/node_modules/event-emitter/has-listeners.js
deleted file mode 100644
index 8744522..0000000
--- a/system/websocket_test/node_modules/event-emitter/has-listeners.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-var isEmpty = require('es5-ext/object/is-empty')
- , value = require('es5-ext/object/valid-value')
-
- , hasOwnProperty = Object.prototype.hasOwnProperty;
-
-module.exports = function (obj/*, type*/) {
- var type;
- value(obj);
- type = arguments[1];
- if (arguments.length > 1) {
- return hasOwnProperty.call(obj, '__ee__') && Boolean(obj.__ee__[type]);
- }
- return obj.hasOwnProperty('__ee__') && !isEmpty(obj.__ee__);
-};
diff --git a/system/websocket_test/node_modules/event-emitter/index.js b/system/websocket_test/node_modules/event-emitter/index.js
deleted file mode 100644
index c36d3e4..0000000
--- a/system/websocket_test/node_modules/event-emitter/index.js
+++ /dev/null
@@ -1,132 +0,0 @@
-'use strict';
-
-var d = require('d')
- , callable = require('es5-ext/object/valid-callable')
-
- , apply = Function.prototype.apply, call = Function.prototype.call
- , create = Object.create, defineProperty = Object.defineProperty
- , defineProperties = Object.defineProperties
- , hasOwnProperty = Object.prototype.hasOwnProperty
- , descriptor = { configurable: true, enumerable: false, writable: true }
-
- , on, once, off, emit, methods, descriptors, base;
-
-on = function (type, listener) {
- var data;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) {
- data = descriptor.value = create(null);
- defineProperty(this, '__ee__', descriptor);
- descriptor.value = null;
- } else {
- data = this.__ee__;
- }
- if (!data[type]) data[type] = listener;
- else if (typeof data[type] === 'object') data[type].push(listener);
- else data[type] = [data[type], listener];
-
- return this;
-};
-
-once = function (type, listener) {
- var once, self;
-
- callable(listener);
- self = this;
- on.call(this, type, once = function () {
- off.call(self, type, once);
- apply.call(listener, this, arguments);
- });
-
- once.__eeOnceListener__ = listener;
- return this;
-};
-
-off = function (type, listener) {
- var data, listeners, candidate, i;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) return this;
- data = this.__ee__;
- if (!data[type]) return this;
- listeners = data[type];
-
- if (typeof listeners === 'object') {
- for (i = 0; (candidate = listeners[i]); ++i) {
- if ((candidate === listener) ||
- (candidate.__eeOnceListener__ === listener)) {
- if (listeners.length === 2) data[type] = listeners[i ? 0 : 1];
- else listeners.splice(i, 1);
- }
- }
- } else {
- if ((listeners === listener) ||
- (listeners.__eeOnceListener__ === listener)) {
- delete data[type];
- }
- }
-
- return this;
-};
-
-emit = function (type) {
- var i, l, listener, listeners, args;
-
- if (!hasOwnProperty.call(this, '__ee__')) return;
- listeners = this.__ee__[type];
- if (!listeners) return;
-
- if (typeof listeners === 'object') {
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) args[i - 1] = arguments[i];
-
- listeners = listeners.slice();
- for (i = 0; (listener = listeners[i]); ++i) {
- apply.call(listener, this, args);
- }
- } else {
- switch (arguments.length) {
- case 1:
- call.call(listeners, this);
- break;
- case 2:
- call.call(listeners, this, arguments[1]);
- break;
- case 3:
- call.call(listeners, this, arguments[1], arguments[2]);
- break;
- default:
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) {
- args[i - 1] = arguments[i];
- }
- apply.call(listeners, this, args);
- }
- }
-};
-
-methods = {
- on: on,
- once: once,
- off: off,
- emit: emit
-};
-
-descriptors = {
- on: d(on),
- once: d(once),
- off: d(off),
- emit: d(emit)
-};
-
-base = defineProperties({}, descriptors);
-
-module.exports = exports = function (o) {
- return (o == null) ? create(base) : defineProperties(Object(o), descriptors);
-};
-exports.methods = methods;
diff --git a/system/websocket_test/node_modules/event-emitter/package.json b/system/websocket_test/node_modules/event-emitter/package.json
deleted file mode 100644
index 8784036..0000000
--- a/system/websocket_test/node_modules/event-emitter/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "event-emitter",
- "version": "0.3.5",
- "description": "Environment agnostic event emitter",
- "author": "Mariusz Nowak (http://www.medikoo.com/)",
- "keywords": [
- "event",
- "events",
- "trigger",
- "observer",
- "listener",
- "emitter",
- "pubsub"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/medikoo/event-emitter.git"
- },
- "dependencies": {
- "es5-ext": "~0.10.14",
- "d": "1"
- },
- "devDependencies": {
- "tad": "~0.2.7",
- "xlint": "~0.2.2",
- "xlint-jslint-medikoo": "~0.1.4"
- },
- "scripts": {
- "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
- "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
- "test": "node ./node_modules/tad/bin/tad"
- },
- "license": "MIT"
-}
diff --git a/system/websocket_test/node_modules/event-emitter/pipe.js b/system/websocket_test/node_modules/event-emitter/pipe.js
deleted file mode 100644
index 0088efe..0000000
--- a/system/websocket_test/node_modules/event-emitter/pipe.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-var aFrom = require('es5-ext/array/from')
- , remove = require('es5-ext/array/#/remove')
- , value = require('es5-ext/object/valid-object')
- , d = require('d')
- , emit = require('./').methods.emit
-
- , defineProperty = Object.defineProperty
- , hasOwnProperty = Object.prototype.hasOwnProperty
- , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
-
-module.exports = function (e1, e2/*, name*/) {
- var pipes, pipe, desc, name;
-
- (value(e1) && value(e2));
- name = arguments[2];
- if (name === undefined) name = 'emit';
-
- pipe = {
- close: function () { remove.call(pipes, e2); }
- };
- if (hasOwnProperty.call(e1, '__eePipes__')) {
- (pipes = e1.__eePipes__).push(e2);
- return pipe;
- }
- defineProperty(e1, '__eePipes__', d('c', pipes = [e2]));
- desc = getOwnPropertyDescriptor(e1, name);
- if (!desc) {
- desc = d('c', undefined);
- } else {
- delete desc.get;
- delete desc.set;
- }
- desc.value = function () {
- var i, emitter, data = aFrom(pipes);
- emit.apply(this, arguments);
- for (i = 0; (emitter = data[i]); ++i) emit.apply(emitter, arguments);
- };
- defineProperty(e1, name, desc);
- return pipe;
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/all-off.js b/system/websocket_test/node_modules/event-emitter/test/all-off.js
deleted file mode 100644
index 8aa872e..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/all-off.js
+++ /dev/null
@@ -1,48 +0,0 @@
-'use strict';
-
-var ee = require('../');
-
-module.exports = function (t, a) {
- var x, count, count2;
-
- x = ee();
- count = 0;
- count2 = 0;
- x.on('foo', function () {
- ++count;
- });
- x.on('foo', function () {
- ++count;
- });
- x.on('bar', function () {
- ++count2;
- });
- x.on('bar', function () {
- ++count2;
- });
- t(x, 'foo');
- x.emit('foo');
- x.emit('bar');
- a(count, 0, "All off: type");
- a(count2, 2, "All off: ohter type");
-
- count = 0;
- count2 = 0;
- x.on('foo', function () {
- ++count;
- });
- x.on('foo', function () {
- ++count;
- });
- x.on('bar', function () {
- ++count2;
- });
- x.on('bar', function () {
- ++count2;
- });
- t(x);
- x.emit('foo');
- x.emit('bar');
- a(count, 0, "All off: type");
- a(count2, 0, "All off: other type");
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/emit-error.js b/system/websocket_test/node_modules/event-emitter/test/emit-error.js
deleted file mode 100644
index edac350..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/emit-error.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-var customError = require('es5-ext/error/custom')
- , ee = require('../');
-
-module.exports = function (t, a) {
- var x, error = customError('Some error', 'ERROR_TEST'), emitted;
-
- x = ee();
- a.throws(function () { t.call(x, error); }, 'ERROR_TEST');
- x.on('error', function (err) { emitted = err; });
- t.call(x, error);
- a(emitted, error);
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/has-listeners.js b/system/websocket_test/node_modules/event-emitter/test/has-listeners.js
deleted file mode 100644
index 875b048..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/has-listeners.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-var ee = require('../');
-
-module.exports = function (t) {
- var x, y;
- return {
- Any: function (a) {
- a(t(true), false, "Primitive");
- a(t({ events: [] }), false, "Other object");
- a(t(x = ee()), false, "Emitter: empty");
-
- x.on('test', y = function () {});
- a(t(x), true, "Emitter: full");
- x.off('test', y);
- a(t(x), false, "Emitter: empty but touched");
- x.once('test', y = function () {});
- a(t(x), true, "Emitter: full: Once");
- x.off('test', y);
- a(t(x), false, "Emitter: empty but touched by once");
- },
- Specific: function (a) {
- a(t(true, 'test'), false, "Primitive");
- a(t({ events: [] }, 'test'), false, "Other object");
- a(t(x = ee(), 'test'), false, "Emitter: empty");
-
- x.on('test', y = function () {});
- a(t(x, 'test'), true, "Emitter: full");
- a(t(x, 'foo'), false, "Emitter: full, other event");
- x.off('test', y);
- a(t(x, 'test'), false, "Emitter: empty but touched");
- a(t(x, 'foo'), false, "Emitter: empty but touched, other event");
-
- x.once('test', y = function () {});
- a(t(x, 'test'), true, "Emitter: full: Once");
- a(t(x, 'foo'), false, "Emitter: full: Once, other event");
- x.off('test', y);
- a(t(x, 'test'), false, "Emitter: empty but touched by once");
- a(t(x, 'foo'), false, "Emitter: empty but touched by once, other event");
- }
- };
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/index.js b/system/websocket_test/node_modules/event-emitter/test/index.js
deleted file mode 100644
index c7c3f24..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/index.js
+++ /dev/null
@@ -1,107 +0,0 @@
-'use strict';
-
-module.exports = function (t, a) {
- var x = t(), y, count, count2, count3, count4, test, listener1, listener2;
-
- x.emit('none');
-
- test = "Once: ";
- count = 0;
- x.once('foo', function (a1, a2, a3) {
- a(this, x, test + "Context");
- a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
- ++count;
- });
-
- x.emit('foobar');
- a(count, 0, test + "Not invoked on other event");
- x.emit('foo', 'foo', x, 15);
- a(count, 1, test + "Emitted");
- x.emit('foo');
- a(count, 1, test + "Emitted once");
-
- test = "On & Once: ";
- count = 0;
- x.on('foo', listener1 = function (a1, a2, a3) {
- a(this, x, test + "Context");
- a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
- ++count;
- });
- count2 = 0;
- x.once('foo', listener2 = function (a1, a2, a3) {
- a(this, x, test + "Context");
- a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
- ++count2;
- });
-
- x.emit('foobar');
- a(count, 0, test + "Not invoked on other event");
- x.emit('foo', 'foo', x, 15);
- a(count, 1, test + "Emitted");
- x.emit('foo', 'foo', x, 15);
- a(count, 2, test + "Emitted twice");
- a(count2, 1, test + "Emitted once");
- x.off('foo', listener1);
- x.emit('foo');
- a(count, 2, test + "Not emitter after off");
-
- count = 0;
- x.once('foo', listener1 = function () { ++count; });
-
- x.off('foo', listener1);
- x.emit('foo');
- a(count, 0, "Once Off: Not emitted");
-
- count = 0;
- x.on('foo', listener2 = function () {});
- x.once('foo', listener1 = function () { ++count; });
-
- x.off('foo', listener1);
- x.emit('foo');
- a(count, 0, "Once Off (multi): Not emitted");
- x.off('foo', listener2);
-
- test = "Prototype Share: ";
-
- y = Object.create(x);
-
- count = 0;
- count2 = 0;
- count3 = 0;
- count4 = 0;
- x.on('foo', function () {
- ++count;
- });
- y.on('foo', function () {
- ++count2;
- });
- x.once('foo', function () {
- ++count3;
- });
- y.once('foo', function () {
- ++count4;
- });
- x.emit('foo');
- a(count, 1, test + "x on count");
- a(count2, 0, test + "y on count");
- a(count3, 1, test + "x once count");
- a(count4, 0, test + "y once count");
-
- y.emit('foo');
- a(count, 1, test + "x on count");
- a(count2, 1, test + "y on count");
- a(count3, 1, test + "x once count");
- a(count4, 1, test + "y once count");
-
- x.emit('foo');
- a(count, 2, test + "x on count");
- a(count2, 1, test + "y on count");
- a(count3, 1, test + "x once count");
- a(count4, 1, test + "y once count");
-
- y.emit('foo');
- a(count, 2, test + "x on count");
- a(count2, 2, test + "y on count");
- a(count3, 1, test + "x once count");
- a(count4, 1, test + "y once count");
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/pipe.js b/system/websocket_test/node_modules/event-emitter/test/pipe.js
deleted file mode 100644
index 9d15d6d..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/pipe.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-var ee = require('../');
-
-module.exports = function (t, a) {
- var x = {}, y = {}, z = {}, count, count2, count3, pipe;
-
- ee(x);
- x = Object.create(x);
- ee(y);
- ee(z);
-
- count = 0;
- count2 = 0;
- count3 = 0;
- x.on('foo', function () {
- ++count;
- });
- y.on('foo', function () {
- ++count2;
- });
- z.on('foo', function () {
- ++count3;
- });
-
- x.emit('foo');
- a(count, 1, "Pre pipe, x");
- a(count2, 0, "Pre pipe, y");
- a(count3, 0, "Pre pipe, z");
-
- pipe = t(x, y);
- x.emit('foo');
- a(count, 2, "Post pipe, x");
- a(count2, 1, "Post pipe, y");
- a(count3, 0, "Post pipe, z");
-
- y.emit('foo');
- a(count, 2, "Post pipe, on y, x");
- a(count2, 2, "Post pipe, on y, y");
- a(count3, 0, "Post pipe, on y, z");
-
- t(x, z);
- x.emit('foo');
- a(count, 3, "Post pipe z, x");
- a(count2, 3, "Post pipe z, y");
- a(count3, 1, "Post pipe z, z");
-
- pipe.close();
- x.emit('foo');
- a(count, 4, "Close pipe y, x");
- a(count2, 3, "Close pipe y, y");
- a(count3, 2, "Close pipe y, z");
-};
diff --git a/system/websocket_test/node_modules/event-emitter/test/unify.js b/system/websocket_test/node_modules/event-emitter/test/unify.js
deleted file mode 100644
index 69295e0..0000000
--- a/system/websocket_test/node_modules/event-emitter/test/unify.js
+++ /dev/null
@@ -1,123 +0,0 @@
-'use strict';
-
-var ee = require('../');
-
-module.exports = function (t) {
-
- return {
- "": function (a) {
- var x = {}, y = {}, z = {}, count, count2, count3;
-
- ee(x);
- ee(y);
- ee(z);
-
- count = 0;
- count2 = 0;
- count3 = 0;
- x.on('foo', function () { ++count; });
- y.on('foo', function () { ++count2; });
- z.on('foo', function () { ++count3; });
-
- x.emit('foo');
- a(count, 1, "Pre unify, x");
- a(count2, 0, "Pre unify, y");
- a(count3, 0, "Pre unify, z");
-
- t(x, y);
- a(x.__ee__, y.__ee__, "Post unify y");
- x.emit('foo');
- a(count, 2, "Post unify, x");
- a(count2, 1, "Post unify, y");
- a(count3, 0, "Post unify, z");
-
- y.emit('foo');
- a(count, 3, "Post unify, on y, x");
- a(count2, 2, "Post unify, on y, y");
- a(count3, 0, "Post unify, on y, z");
-
- t(x, z);
- a(x.__ee__, x.__ee__, "Post unify z");
- x.emit('foo');
- a(count, 4, "Post unify z, x");
- a(count2, 3, "Post unify z, y");
- a(count3, 1, "Post unify z, z");
- },
- "On empty": function (a) {
- var x = {}, y = {}, z = {}, count, count2, count3;
-
- ee(x);
- ee(y);
- ee(z);
-
- count = 0;
- count2 = 0;
- count3 = 0;
- y.on('foo', function () { ++count2; });
- x.emit('foo');
- a(count, 0, "Pre unify, x");
- a(count2, 0, "Pre unify, y");
- a(count3, 0, "Pre unify, z");
-
- t(x, y);
- a(x.__ee__, y.__ee__, "Post unify y");
- x.on('foo', function () { ++count; });
- x.emit('foo');
- a(count, 1, "Post unify, x");
- a(count2, 1, "Post unify, y");
- a(count3, 0, "Post unify, z");
-
- y.emit('foo');
- a(count, 2, "Post unify, on y, x");
- a(count2, 2, "Post unify, on y, y");
- a(count3, 0, "Post unify, on y, z");
-
- t(x, z);
- a(x.__ee__, z.__ee__, "Post unify z");
- z.on('foo', function () { ++count3; });
- x.emit('foo');
- a(count, 3, "Post unify z, x");
- a(count2, 3, "Post unify z, y");
- a(count3, 1, "Post unify z, z");
- },
- Many: function (a) {
- var x = {}, y = {}, z = {}, count, count2, count3;
-
- ee(x);
- ee(y);
- ee(z);
-
- count = 0;
- count2 = 0;
- count3 = 0;
- x.on('foo', function () { ++count; });
- y.on('foo', function () { ++count2; });
- y.on('foo', function () { ++count2; });
- z.on('foo', function () { ++count3; });
-
- x.emit('foo');
- a(count, 1, "Pre unify, x");
- a(count2, 0, "Pre unify, y");
- a(count3, 0, "Pre unify, z");
-
- t(x, y);
- a(x.__ee__, y.__ee__, "Post unify y");
- x.emit('foo');
- a(count, 2, "Post unify, x");
- a(count2, 2, "Post unify, y");
- a(count3, 0, "Post unify, z");
-
- y.emit('foo');
- a(count, 3, "Post unify, on y, x");
- a(count2, 4, "Post unify, on y, y");
- a(count3, 0, "Post unify, on y, z");
-
- t(x, z);
- a(x.__ee__, x.__ee__, "Post unify z");
- x.emit('foo');
- a(count, 4, "Post unify z, x");
- a(count2, 6, "Post unify z, y");
- a(count3, 1, "Post unify z, z");
- }
- };
-};
diff --git a/system/websocket_test/node_modules/event-emitter/unify.js b/system/websocket_test/node_modules/event-emitter/unify.js
deleted file mode 100644
index c6a858a..0000000
--- a/system/websocket_test/node_modules/event-emitter/unify.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-
-var forEach = require('es5-ext/object/for-each')
- , validValue = require('es5-ext/object/valid-object')
-
- , push = Array.prototype.apply, defineProperty = Object.defineProperty
- , create = Object.create, hasOwnProperty = Object.prototype.hasOwnProperty
- , d = { configurable: true, enumerable: false, writable: true };
-
-module.exports = function (e1, e2) {
- var data;
- (validValue(e1) && validValue(e2));
- if (!hasOwnProperty.call(e1, '__ee__')) {
- if (!hasOwnProperty.call(e2, '__ee__')) {
- d.value = create(null);
- defineProperty(e1, '__ee__', d);
- defineProperty(e2, '__ee__', d);
- d.value = null;
- return;
- }
- d.value = e2.__ee__;
- defineProperty(e1, '__ee__', d);
- d.value = null;
- return;
- }
- data = d.value = e1.__ee__;
- if (!hasOwnProperty.call(e2, '__ee__')) {
- defineProperty(e2, '__ee__', d);
- d.value = null;
- return;
- }
- if (data === e2.__ee__) return;
- forEach(e2.__ee__, function (listener, name) {
- if (!data[name]) {
- data[name] = listener;
- return;
- }
- if (typeof data[name] === 'object') {
- if (typeof listener === 'object') push.apply(data[name], listener);
- else data[name].push(listener);
- } else if (typeof listener === 'object') {
- listener.unshift(data[name]);
- data[name] = listener;
- } else {
- data[name] = [data[name], listener];
- }
- });
- defineProperty(e2, '__ee__', d);
- d.value = null;
-};
diff --git a/system/websocket_test/node_modules/ext/CHANGELOG.md b/system/websocket_test/node_modules/ext/CHANGELOG.md
deleted file mode 100644
index 48bffa3..0000000
--- a/system/websocket_test/node_modules/ext/CHANGELOG.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-## [1.7.0](https://github.com/medikoo/es5-ext/compare/v1.6.0...v1.7.0) (2022-08-31)
-
-### Features
-
-- `string.camelToHyphen` method ([b8ea4ab](https://github.com/medikoo/es5-ext/commit/b8ea4ab6c8b920ecdff224f9c92092e1c7f8cdfc))
-- `string.capitalize` method ([32e7360](https://github.com/medikoo/es5-ext/commit/32e736034bd27ed25d4566b22aa93aa66c7901cf))
-
-## [1.6.0](https://github.com/medikoo/es5-ext/compare/v1.5.0...v1.6.0) (2021-09-24)
-
-### Features
-
-- `Object.clear` util ([a955da4](https://github.com/medikoo/es5-ext/commit/a955da41e65a25ad87a46234bae065f096abd1d2))
-
-### Bug Fixes
-
-- Fix `Object.entries` to not return non enumerable properties ([44fb872](https://github.com/medikoo/es5-ext/commit/44fb87266617378d2f47a1a5baad6280bf6298a8))
-
-## [1.5.0](https://github.com/medikoo/es5-ext/compare/v1.3.0...v1.5.0) (2021-08-23)
-
-### Features
-
-- `Promise.limit` ([060a05d](https://github.com/medikoo/es5-ext/commit/060a05d4751cd291c6dd7641f5a73ba9338ea7ab))
-- `String.prototype.includes` ([ceebe8d](https://github.com/medikoo/es5-ext/commit/ceebe8dfd6f479d6a7e7b6cd79369291869ee2dd))
-- `charset` option for `String.random` ([2a20eeb](https://github.com/medikoo/es5-ext/commit/2a20eebc5ae784e5c1aacd2c54433fe92a9464c9))
-
-## [1.4.0](https://github.com///compare/v1.3.0...v1.4.0) (2019-11-29)
-
-### Features
-
-- `charset` option for `String.random` ([2a20eeb](https://github.com///commit/2a20eebc5ae784e5c1aacd2c54433fe92a9464c9))
-- `String.prototype.includes` implementation ([ceebe8d](https://github.com///commit/ceebe8dfd6f479d6a7e7b6cd79369291869ee2dd))
-
-## [1.3.0](https://github.com///compare/v1.2.1...v1.3.0) (2019-11-28)
-
-### Features
-
-- `String.random` util ([5b5860a](https://github.com///commit/5b5860ac545b05f00527e00295fdb4f97e4a4e5b))
-
-### [1.2.1](https://github.com///compare/v1.2.0...v1.2.1) (2019-11-26)
-
-## [1.2.0](https://github.com/medikoo/ext/compare/v1.1.2...v1.2.0) (2019-11-07)
-
-### Features
-
-- ceil10, floor10 and round10 for Math ([6a2bc4b](https://github.com/medikoo/ext/commit/6a2bc4b))
-
-### [1.1.2](https://github.com/medikoo/ext/compare/v1.1.1...v1.1.2) (2019-10-29)
-
-### Bug Fixes
-
-- Improve globalThis detection ([470862d](https://github.com/medikoo/ext/commit/470862d))
-
-### [1.1.1](https://github.com/medikoo/ext/compare/v1.1.0...v1.1.1) (2019-10-29)
-
-### Bug Fixes
-
-- Provide naive fallback for sealed Object.prototype case ([a8d528b](https://github.com/medikoo/ext/commit/a8d528b))
-- Workaournd Safari incompatibility case ([0b051e6](https://github.com/medikoo/ext/commit/0b051e6))
-
-## [1.1.0](https://github.com/medikoo/ext/compare/v1.0.3...v1.1.0) (2019-10-21)
-
-### Features
-
-- Object.entries implementation ([cf51e45](https://github.com/medikoo/ext/commit/cf51e45))
-
-### [1.0.3](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.3) (2019-07-03)
-
-Remove obsolete files from publication
-
-### [1.0.2](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.2) (2019-07-03)
-
-(no changes)
-
-### [1.0.1](https://github.com/medikoo/ext/compare/v1.0.0...v1.0.1) (2019-07-03)
-
-Prettify
-
-## 1.0.0 (2019-07-03)
-
-### Features
-
-- `function/identity` (adapted from `es5-ext`) ([f0102af](https://github.com/medikoo/ext/commit/f0102af))
-- `thenable/finally` (adapted from `es5-ext`) ([a8494ac](https://github.com/medikoo/ext/commit/a8494ac))
-- `global-this/is-implemented` ([3a80904](https://github.com/medikoo/ext/commit/3a80904))
-- `globalThis` (mostly adapted from `es5-ext`) ([6559bd3](https://github.com/medikoo/ext/commit/6559bd3))
diff --git a/system/websocket_test/node_modules/ext/LICENSE b/system/websocket_test/node_modules/ext/LICENSE
deleted file mode 100644
index 7df6b3d..0000000
--- a/system/websocket_test/node_modules/ext/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/system/websocket_test/node_modules/ext/README.md b/system/websocket_test/node_modules/ext/README.md
deleted file mode 100644
index 29491e2..0000000
--- a/system/websocket_test/node_modules/ext/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-[![Build status][build-image]][build-url]
-[![npm version][npm-image]][npm-url]
-
-# ext
-
-_(Previously known as `es5-ext`)_
-
-## JavaScript language extensions (with respect to evolving standard)
-
-Non-standard or soon to be standard language utilities in a future proof, non-invasive form.
-
-Doesn't enforce transpilation step. Where it's applicable utilities/extensions are safe to use in all ES3+ implementations.
-
-### Installation
-
-```bash
-npm install ext
-```
-
-### Utilities
-
-- [`globalThis`](docs/global-this.md)
-- `Function`
- - [`identity`](docs/function/identity.md)
-- `Math`
- - [`ceil10`](docs/math/ceil-10.md)
- - [`floor10`](docs/math/floor-10.md)
- - [`round10`](docs/math/round-10.md)
-- `Object`
- - [`clear`](docs/object/clear.md)
- - [`entries`](docs/object/entries.md)
-- `Promise`
- - [`limit`](docs/promise/limit.md)
-- `String`
- - [`random`](docs/string/random.md)
-- `String.prototype`
- - [`campelToHyphen`](docs/string_/camel-to-hyphen.md)
- - [`capitalize`](docs/string_/capitalize.md)
- - [`includes`](docs/string_/includes.md)
-- `Thenable.prototype`
- - [`finally`](docs/thenable_/finally.md)
-
-[build-image]: https://github.com/medikoo/es5-ext/workflows/Integrate%20[ext]/badge.svg
-[build-url]: https://github.com/medikoo/es5-ext/actions?query=workflow%3AIntegrate%20[ext]
-[npm-image]: https://img.shields.io/npm/v/ext.svg
-[npm-url]: https://www.npmjs.com/package/ext
diff --git a/system/websocket_test/node_modules/ext/docs/function/identity.md b/system/websocket_test/node_modules/ext/docs/function/identity.md
deleted file mode 100644
index b6a5c1d..0000000
--- a/system/websocket_test/node_modules/ext/docs/function/identity.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# `Function.identity` _(ext/function/identity)_
-
-Returns input argument.
-
-```javascript
-const identity = require("ext/function/identity");
-
-identity("foo"); // "foo"
-```
diff --git a/system/websocket_test/node_modules/ext/docs/global-this.md b/system/websocket_test/node_modules/ext/docs/global-this.md
deleted file mode 100644
index fafd422..0000000
--- a/system/websocket_test/node_modules/ext/docs/global-this.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# `globalThis` _(ext/global-this)_
-
-Returns global object. Resolve native [globalThis](https://github.com/tc39/proposal-global) if implemented, otherwise fallback to internal resolution of a global object.
-
-```javascript
-const globalThis = require("ext/global-this");
-
-globalThis.Array === Array; // true
-```
diff --git a/system/websocket_test/node_modules/ext/docs/math/ceil-10.md b/system/websocket_test/node_modules/ext/docs/math/ceil-10.md
deleted file mode 100644
index 1d53122..0000000
--- a/system/websocket_test/node_modules/ext/docs/math/ceil-10.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# `Math.ceil10` _(ext/math/ceil-10)_
-
-Decimal ceil
-
-```javascript
-const ceil10 = require("ext/math/ceil-10");
-
-ceil10(55.51, -1); // 55.6
-ceil10(-59, 1); // -50;
-```
diff --git a/system/websocket_test/node_modules/ext/docs/math/floor-10.md b/system/websocket_test/node_modules/ext/docs/math/floor-10.md
deleted file mode 100644
index 099c1b6..0000000
--- a/system/websocket_test/node_modules/ext/docs/math/floor-10.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# `Math.floor10` _(ext/math/floor-10)_
-
-Decimal floor
-
-```javascript
-const floor10 = require("ext/math/floor-10");
-
-floor10(55.59, -1); // 55.5
-floor10(59, 1); // 50
-```
diff --git a/system/websocket_test/node_modules/ext/docs/math/round-10.md b/system/websocket_test/node_modules/ext/docs/math/round-10.md
deleted file mode 100644
index 727acb1..0000000
--- a/system/websocket_test/node_modules/ext/docs/math/round-10.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# `Math.round10` _(ext/math/round-10)_
-
-Decimal round
-
-```javascript
-const round10 = require("ext/math/round-10");
-
-round10(55.549, -1); // 55.5
-round10(1.005, -2); // 1.01
-```
diff --git a/system/websocket_test/node_modules/ext/docs/object/clear.md b/system/websocket_test/node_modules/ext/docs/object/clear.md
deleted file mode 100644
index 468be1b..0000000
--- a/system/websocket_test/node_modules/ext/docs/object/clear.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# `Object.clear` _(ext/object/clear)_
-
-Deletes all own, enumerable, non-symbol properties in the object
-
-```javascript
-const clear = require("ext/object/clear");
-
-const obj = { foo: "bar" };
-
-clear(obj);
-Object.keys(obj); // []
-```
diff --git a/system/websocket_test/node_modules/ext/docs/object/entries.md b/system/websocket_test/node_modules/ext/docs/object/entries.md
deleted file mode 100644
index 2d05f4c..0000000
--- a/system/websocket_test/node_modules/ext/docs/object/entries.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# `Object.entries` _(ext/object/entries)_
-
-[Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) implementation.
-
-Returns native `Object.entries` if it's implemented, otherwise library implementation is returned
-
-```javascript
-const entries = require("ext/object/entries");
-
-entries({ foo: "bar" }); // [["foo", "bar"]]
-```
diff --git a/system/websocket_test/node_modules/ext/docs/promise/limit.md b/system/websocket_test/node_modules/ext/docs/promise/limit.md
deleted file mode 100644
index 8b0ea38..0000000
--- a/system/websocket_test/node_modules/ext/docs/promise/limit.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# `Promise.limit` _(ext/promise/limit)_
-
-Helps to limit concurrency of asynchronous operations.
-
-```javascript
-const limit = require("ext/promise/limit").bind(Promise);
-
-const limittedAsyncFunction = limit(2, asyncFunction);
-
-imittedAsyncFunction(); // Async operation started
-imittedAsyncFunction(); // Async operation started
-imittedAsyncFunction(); // On hold until one of previously started finalizes
-```
diff --git a/system/websocket_test/node_modules/ext/docs/string/random.md b/system/websocket_test/node_modules/ext/docs/string/random.md
deleted file mode 100644
index c3099e9..0000000
--- a/system/websocket_test/node_modules/ext/docs/string/random.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# `String.random(options = { ... })` _(ext/string/random)_
-
-Returns generated random string, contained only of ascii cars `a-z` and `0-1`.
-By default returns string of length `10`.
-
-```javascript
-const random = require("ext/string/random");
-
-random(); // "upcfns0i4t"
-random({ length: 3 }); // "5tw"
-```
-
-## Supported options:
-
-### `isUnique: false`
-
-Ensures generated string is unique among ones already returned.
-
-_Note: When not applying this setting, accidental generation of same string is still highly unlikely. Provided option is just to provide a mean to eliminate possibility of an edge case of duplicate string being returned_
-
-### `length: 10`
-
-Desired length of result string
-
-### `charset: null`
-
-Fixed list of possible characters
-
-```javascript
-random({ charset: "abc" }); // "bacbccbbac"
-```
diff --git a/system/websocket_test/node_modules/ext/docs/string_/camel-to-hyphen.md b/system/websocket_test/node_modules/ext/docs/string_/camel-to-hyphen.md
deleted file mode 100644
index e3e4c03..0000000
--- a/system/websocket_test/node_modules/ext/docs/string_/camel-to-hyphen.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# `string.camelToHyphen()` _(ext/string\_/camel-to-hyphen)_
-
-Convert camelCase string to hyphen separated, e.g. `oneTwoThree` into `one-to-three`. Useful when converting names from js property convention into filename convention.
-
-```javascript
-const camelToHyphen = require("ext/string_/camelToHyphen");
-
-camelToHyphen.call("razDwaTrzy"); // raz-dwa-trzy
-```
diff --git a/system/websocket_test/node_modules/ext/docs/string_/capitalize.md b/system/websocket_test/node_modules/ext/docs/string_/capitalize.md
deleted file mode 100644
index 319e194..0000000
--- a/system/websocket_test/node_modules/ext/docs/string_/capitalize.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# `string.capitalize()` _(ext/string\_/capitalize)_
-
-Capitalize input string, e.g. convert `this is a test` into `This is a test`.
-
-```javascript
-const capitalize = require("ext/string_/capitalize");
-
-capitalize.call("this is a test"); // This is a test
-```
diff --git a/system/websocket_test/node_modules/ext/docs/string_/includes.md b/system/websocket_test/node_modules/ext/docs/string_/includes.md
deleted file mode 100644
index 4fe1b58..0000000
--- a/system/websocket_test/node_modules/ext/docs/string_/includes.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# `string.includes(position = 0)` _(ext/string\_/includes)_
-
-`includes` method for strings. Resolve native [includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) if implemented, otherwise fallback to shim implementation.
-
-```javascript
-const includes = require("ext/string_/includes");
-
-includes.call("razdwa", "raz"); // true
-includes.call("razdwa", "trzy"); // false
-```
diff --git a/system/websocket_test/node_modules/ext/docs/thenable_/finally.md b/system/websocket_test/node_modules/ext/docs/thenable_/finally.md
deleted file mode 100644
index 978ce0c..0000000
--- a/system/websocket_test/node_modules/ext/docs/thenable_/finally.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# `thenable.finally` _(ext/thenable\_/finally)_
-
-`finally` method for any _thenable_ input
-
-```javascript
-const finally = require("ext/thenable_/finally");
-
-finally.call(thenable, () => console.log("Thenable resolved"));
-```
diff --git a/system/websocket_test/node_modules/ext/function/identity.js b/system/websocket_test/node_modules/ext/function/identity.js
deleted file mode 100644
index cde213f..0000000
--- a/system/websocket_test/node_modules/ext/function/identity.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = function (value) { return value; };
diff --git a/system/websocket_test/node_modules/ext/global-this/implementation.js b/system/websocket_test/node_modules/ext/global-this/implementation.js
deleted file mode 100644
index 6a06d52..0000000
--- a/system/websocket_test/node_modules/ext/global-this/implementation.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var naiveFallback = function () {
- if (typeof self === "object" && self) return self;
- if (typeof window === "object" && window) return window;
- throw new Error("Unable to resolve global `this`");
-};
-
-module.exports = (function () {
- if (this) return this;
-
- // Unexpected strict mode (may happen if e.g. bundled into ESM module)
-
- // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
- // In all ES5+ engines global object inherits from Object.prototype
- // (if you approached one that doesn't please report)
- try {
- Object.defineProperty(Object.prototype, "__global__", {
- get: function () { return this; },
- configurable: true
- });
- } catch (error) {
- // Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze)
- return naiveFallback();
- }
- try {
- // Safari case (window.__global__ is resolved with global context, but __global__ does not)
- if (!__global__) return naiveFallback();
- return __global__;
- } finally {
- delete Object.prototype.__global__;
- }
-})();
diff --git a/system/websocket_test/node_modules/ext/global-this/index.js b/system/websocket_test/node_modules/ext/global-this/index.js
deleted file mode 100644
index 8a99c25..0000000
--- a/system/websocket_test/node_modules/ext/global-this/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("./is-implemented")() ? globalThis : require("./implementation");
diff --git a/system/websocket_test/node_modules/ext/global-this/is-implemented.js b/system/websocket_test/node_modules/ext/global-this/is-implemented.js
deleted file mode 100644
index 3eae23e..0000000
--- a/system/websocket_test/node_modules/ext/global-this/is-implemented.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = function () {
- if (typeof globalThis !== "object") return false;
- if (!globalThis) return false;
- return globalThis.Array === Array;
-};
diff --git a/system/websocket_test/node_modules/ext/lib/private/decimal-adjust.js b/system/websocket_test/node_modules/ext/lib/private/decimal-adjust.js
deleted file mode 100644
index e04cde9..0000000
--- a/system/websocket_test/node_modules/ext/lib/private/decimal-adjust.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Credit:
-// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
-// #Decimal_rounding
-
-"use strict";
-
-var isValue = require("type/object/is")
- , ensureInteger = require("type/integer/ensure");
-
-var split = String.prototype.split;
-
-module.exports = function (type) {
- return function (value/*, exp*/) {
- value = Number(value);
- var exp = arguments[1];
- if (isValue(exp)) exp = ensureInteger(exp);
- if (!value) return value;
- if (!exp) return Math[type](value);
- if (!isFinite(value)) return value;
-
- // Shift
- var tokens = split.call(value, "e");
- value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp));
-
- // Shift back
- tokens = value.toString().split("e");
- return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp));
- };
-};
diff --git a/system/websocket_test/node_modules/ext/lib/private/define-function-length.js b/system/websocket_test/node_modules/ext/lib/private/define-function-length.js
deleted file mode 100644
index 4db3228..0000000
--- a/system/websocket_test/node_modules/ext/lib/private/define-function-length.js
+++ /dev/null
@@ -1,56 +0,0 @@
-"use strict";
-
-var test = function (arg1, arg2) { return arg2; };
-
-try {
- Object.defineProperty(test, "length", {
- configurable: true,
- writable: false,
- enumerable: false,
- value: 1
- });
-}
-catch (ignore) {}
-
-if (test.length === 1) {
- // ES2015+
- var desc = { configurable: true, writable: false, enumerable: false };
- module.exports = function (length, fn) {
- if (fn.length === length) return fn;
- desc.value = length;
- return Object.defineProperty(fn, "length", desc);
- };
- return;
-}
-
-module.exports = function (length, fn) {
- if (fn.length === length) return fn;
- switch (length) {
- case 0:
- return function () { return fn.apply(this, arguments); };
- case 1:
- return function (ignored1) { return fn.apply(this, arguments); };
- case 2:
- return function (ignored1, ignored2) { return fn.apply(this, arguments); };
- case 3:
- return function (ignored1, ignored2, ignored3) { return fn.apply(this, arguments); };
- case 4:
- return function (ignored1, ignored2, ignored3, ignored4) {
- return fn.apply(this, arguments);
- };
- case 5:
- return function (ignored1, ignored2, ignored3, ignored4, ignored5) {
- return fn.apply(this, arguments);
- };
- case 6:
- return function (ignored1, ignored2, ignored3, ignored4, ignored5, ignored6) {
- return fn.apply(this, arguments);
- };
- case 7:
- return function (ignored1, ignored2, ignored3, ignored4, ignored5, ignored6, ignored7) {
- return fn.apply(this, arguments);
- };
- default:
- throw new Error("Usupported function length");
- }
-};
diff --git a/system/websocket_test/node_modules/ext/math/ceil-10.js b/system/websocket_test/node_modules/ext/math/ceil-10.js
deleted file mode 100644
index c57a730..0000000
--- a/system/websocket_test/node_modules/ext/math/ceil-10.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("../lib/private/decimal-adjust")("ceil");
diff --git a/system/websocket_test/node_modules/ext/math/floor-10.js b/system/websocket_test/node_modules/ext/math/floor-10.js
deleted file mode 100644
index 27dd1aa..0000000
--- a/system/websocket_test/node_modules/ext/math/floor-10.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("../lib/private/decimal-adjust")("floor");
diff --git a/system/websocket_test/node_modules/ext/math/round-10.js b/system/websocket_test/node_modules/ext/math/round-10.js
deleted file mode 100644
index 643d676..0000000
--- a/system/websocket_test/node_modules/ext/math/round-10.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("../lib/private/decimal-adjust")("round");
diff --git a/system/websocket_test/node_modules/ext/object/clear.js b/system/websocket_test/node_modules/ext/object/clear.js
deleted file mode 100644
index be3be2b..0000000
--- a/system/websocket_test/node_modules/ext/object/clear.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var ensureObject = require("type/object/ensure")
- , ensure = require("type/ensure");
-
-var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-module.exports = function (object) {
- ensure(["object", object, ensureObject]);
- for (var key in object) {
- if (!objPropertyIsEnumerable.call(object, key)) continue;
- delete object[key];
- }
- return object;
-};
diff --git a/system/websocket_test/node_modules/ext/object/entries/implement.js b/system/websocket_test/node_modules/ext/object/entries/implement.js
deleted file mode 100644
index 383ceee..0000000
--- a/system/websocket_test/node_modules/ext/object/entries/implement.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-if (!require("./is-implemented")()) {
- Object.defineProperty(Object, "entries", {
- value: require("./implementation"),
- configurable: true,
- enumerable: false,
- writable: true
- });
-}
diff --git a/system/websocket_test/node_modules/ext/object/entries/implementation.js b/system/websocket_test/node_modules/ext/object/entries/implementation.js
deleted file mode 100644
index d6f121c..0000000
--- a/system/websocket_test/node_modules/ext/object/entries/implementation.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var ensureValue = require("type/value/ensure");
-
-var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-module.exports = function (object) {
- object = Object(ensureValue(object));
- var result = [];
- for (var key in object) {
- if (!objPropertyIsEnumerable.call(object, key)) continue;
- result.push([key, object[key]]);
- }
- return result;
-};
diff --git a/system/websocket_test/node_modules/ext/object/entries/index.js b/system/websocket_test/node_modules/ext/object/entries/index.js
deleted file mode 100644
index 0a784d6..0000000
--- a/system/websocket_test/node_modules/ext/object/entries/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = require("./is-implemented")() ? Object.entries : require("./implementation");
diff --git a/system/websocket_test/node_modules/ext/object/entries/is-implemented.js b/system/websocket_test/node_modules/ext/object/entries/is-implemented.js
deleted file mode 100644
index aad52b2..0000000
--- a/system/websocket_test/node_modules/ext/object/entries/is-implemented.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-
-module.exports = function () {
- try { return Object.entries({ foo: 12 })[0][0] === "foo"; }
- catch (e) { return false; }
-};
diff --git a/system/websocket_test/node_modules/ext/package.json b/system/websocket_test/node_modules/ext/package.json
deleted file mode 100644
index 4bf9e12..0000000
--- a/system/websocket_test/node_modules/ext/package.json
+++ /dev/null
@@ -1,152 +0,0 @@
-{
- "name": "ext",
- "version": "1.7.0",
- "description": "JavaScript utilities with respect to emerging standard",
- "author": "Mariusz Nowak (http://www.medikoo.com/)",
- "keywords": [
- "ecmascript",
- "es",
- "es6",
- "extensions",
- "ext",
- "addons",
- "lodash",
- "extras",
- "harmony",
- "javascript",
- "polyfill",
- "shim",
- "util",
- "utils",
- "utilities"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/medikoo/es5-ext#ext"
- },
- "dependencies": {
- "type": "^2.7.2"
- },
- "devDependencies": {
- "chai": "^4.3.6",
- "eslint": "^8.23.0",
- "eslint-config-medikoo": "^4.1.2",
- "git-list-updated": "^1.2.1",
- "github-release-from-cc-changelog": "^2.3.0",
- "husky": "^4.3.8",
- "lint-staged": "^13.0.3",
- "mocha": "^6.2.3",
- "nyc": "^15.1.0",
- "prettier-elastic": "^2.2.1",
- "sinon": "^8.1.1",
- "timers-ext": "^0.1.7"
- },
- "husky": {
- "hooks": {
- "pre-commit": "lint-staged"
- }
- },
- "lint-staged": {
- "*.js": [
- "eslint"
- ],
- "*.{css,html,js,json,md,yaml,yml}": [
- "prettier -c"
- ]
- },
- "eslintIgnore": [
- "_es5-ext"
- ],
- "eslintConfig": {
- "extends": "medikoo/es3",
- "root": true,
- "overrides": [
- {
- "files": "global-this/implementation.js",
- "globals": {
- "__global__": true,
- "self": true,
- "window": true
- },
- "rules": {
- "no-extend-native": "off",
- "strict": "off"
- }
- },
- {
- "files": [
- "global-this/is-implemented.js",
- "global-this/index.js"
- ],
- "globals": {
- "globalThis": true
- }
- },
- {
- "files": "string_/camel-to-hyphen.js",
- "rules": {
- "id-length": "off"
- }
- },
- {
- "files": "test/**/*.js",
- "env": {
- "mocha": true
- }
- },
- {
- "files": [
- "test/promise/limit.js",
- "test/thenable_/finally.js"
- ],
- "globals": {
- "Promise": true
- }
- }
- ]
- },
- "prettier": {
- "printWidth": 100,
- "tabWidth": 4,
- "overrides": [
- {
- "files": [
- "*.md",
- "*.yml"
- ],
- "options": {
- "tabWidth": 2
- }
- }
- ]
- },
- "mocha": {
- "recursive": true
- },
- "nyc": {
- "all": true,
- "exclude": [
- ".github",
- "_es5-ext",
- "coverage/**",
- "test/**",
- "*.config.js"
- ],
- "reporter": [
- "lcov",
- "html",
- "text-summary"
- ]
- },
- "scripts": {
- "coverage": "nyc npm test",
- "lint": "eslint .",
- "lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
- "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
- "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
- "prettify:updated": "pipe-git-updated ---base=main -ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
- "test": "mocha"
- },
- "license": "ISC"
-}
diff --git a/system/websocket_test/node_modules/ext/promise/limit.js b/system/websocket_test/node_modules/ext/promise/limit.js
deleted file mode 100644
index 841afad..0000000
--- a/system/websocket_test/node_modules/ext/promise/limit.js
+++ /dev/null
@@ -1,62 +0,0 @@
-"use strict";
-
-var ensureNaturalNumber = require("type/natural-number/ensure")
- , ensurePlainFunction = require("type/plain-function/ensure")
- , ensure = require("type/ensure")
- , defineFunctionLength = require("../lib/private/define-function-length");
-
-module.exports = function (limit, callback) {
- limit = ensure(
- ["limit", limit, ensureNaturalNumber, { min: 1 }],
- ["callback", callback, ensurePlainFunction]
- )[0];
-
- var Promise = this, ongoingCount = 0, pending = [];
- var onSuccess, onFailure;
-
- var release = function () {
- --ongoingCount;
- if (ongoingCount >= limit) return;
- var next = pending.shift();
- if (!next) return;
- ++ongoingCount;
- try {
- next.resolve(
- Promise.resolve(callback.apply(next.context, next.arguments)).then(
- onSuccess, onFailure
- )
- );
- } catch (exception) {
- release();
- next.reject(exception);
- }
- };
-
- onSuccess = function (value) {
- release();
- return value;
- };
-
- onFailure = function (exception) {
- release();
- throw exception;
- };
-
- return defineFunctionLength(callback.length, function () {
- if (ongoingCount >= limit) {
- var context = this, args = arguments;
- return new Promise(function (resolve, reject) {
- pending.push({
- context: context,
- arguments: args,
- resolve: resolve,
- reject: reject
- });
- });
- }
- ++ongoingCount;
- try {
- return Promise.resolve(callback.apply(this, arguments)).then(onSuccess, onFailure);
- } catch (exception) { return onFailure(exception); }
- });
-};
diff --git a/system/websocket_test/node_modules/ext/string/random.js b/system/websocket_test/node_modules/ext/string/random.js
deleted file mode 100644
index c96ef92..0000000
--- a/system/websocket_test/node_modules/ext/string/random.js
+++ /dev/null
@@ -1,50 +0,0 @@
-"use strict";
-
-var isObject = require("type/object/is")
- , ensureNaturalNumber = require("type/natural-number/ensure")
- , ensureString = require("type/string/ensure");
-
-var generated = Object.create(null), random = Math.random, uniqTryLimit = 100;
-
-var getChunk = function () { return random().toString(36).slice(2); };
-
-var getString = function (length, charset) {
- var str;
- if (charset) {
- var charsetLength = charset.length;
- str = "";
- for (var i = 0; i < length; ++i) {
- str += charset.charAt(Math.floor(Math.random() * charsetLength));
- }
- return str;
- }
- str = getChunk();
- if (length === null) return str;
- while (str.length < length) str += getChunk();
- return str.slice(0, length);
-};
-
-module.exports = function (/* options */) {
- var options = arguments[0];
- if (!isObject(options)) options = {};
- var length = ensureNaturalNumber(options.length, { "default": 10 })
- , isUnique = options.isUnique
- , charset = ensureString(options.charset, { isOptional: true });
-
- var str = getString(length, charset);
- if (isUnique) {
- var count = 0;
- while (generated[str]) {
- if (++count === uniqTryLimit) {
- throw new Error(
- "Cannot generate random string.\n" +
- "String.random is not designed to effectively generate many short and " +
- "unique random strings"
- );
- }
- str = getString(length);
- }
- generated[str] = true;
- }
- return str;
-};
diff --git a/system/websocket_test/node_modules/ext/string_/camel-to-hyphen.js b/system/websocket_test/node_modules/ext/string_/camel-to-hyphen.js
deleted file mode 100644
index feffae6..0000000
--- a/system/websocket_test/node_modules/ext/string_/camel-to-hyphen.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure")
- , objHasOwnProperty = Object.prototype.hasOwnProperty;
-
-var capitalLetters = {
- A: true,
- B: true,
- C: true,
- D: true,
- E: true,
- F: true,
- G: true,
- H: true,
- I: true,
- J: true,
- K: true,
- L: true,
- M: true,
- N: true,
- O: true,
- P: true,
- Q: true,
- R: true,
- S: true,
- T: true,
- U: true,
- V: true,
- W: true,
- X: true,
- Y: true,
- Z: true
-};
-
-module.exports = function () {
- var input = ensureString(this);
- if (!input) return input;
- var outputLetters = [];
- for (var index = 0, letter; (letter = input[index]); ++index) {
- if (objHasOwnProperty.call(capitalLetters, letter)) {
- if (index) outputLetters.push("-");
- outputLetters.push(letter.toLowerCase());
- } else {
- outputLetters.push(letter);
- }
- }
-
- return outputLetters.join("");
-};
diff --git a/system/websocket_test/node_modules/ext/string_/capitalize.js b/system/websocket_test/node_modules/ext/string_/capitalize.js
deleted file mode 100644
index bc76311..0000000
--- a/system/websocket_test/node_modules/ext/string_/capitalize.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-var ensureString = require("type/string/ensure");
-
-module.exports = function () {
- var input = ensureString(this);
- if (!input) return input;
- return input.charAt(0).toUpperCase() + input.slice(1);
-};
diff --git a/system/websocket_test/node_modules/ext/string_/includes/implementation.js b/system/websocket_test/node_modules/ext/string_/includes/implementation.js
deleted file mode 100644
index a7219f2..0000000
--- a/system/websocket_test/node_modules/ext/string_/includes/implementation.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-var indexOf = String.prototype.indexOf;
-
-module.exports = function (searchString/*, position*/) {
- return indexOf.call(this, searchString, arguments[1]) > -1;
-};
diff --git a/system/websocket_test/node_modules/ext/string_/includes/index.js b/system/websocket_test/node_modules/ext/string_/includes/index.js
deleted file mode 100644
index ee4e284..0000000
--- a/system/websocket_test/node_modules/ext/string_/includes/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-module.exports = require("./is-implemented")()
- ? String.prototype.includes
- : require("./implementation");
diff --git a/system/websocket_test/node_modules/ext/string_/includes/is-implemented.js b/system/websocket_test/node_modules/ext/string_/includes/is-implemented.js
deleted file mode 100644
index edc4515..0000000
--- a/system/websocket_test/node_modules/ext/string_/includes/is-implemented.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-var str = "razdwatrzy";
-
-module.exports = function () {
- if (typeof str.includes !== "function") return false;
- return str.includes("dwa") === true && str.includes("foo") === false;
-};
diff --git a/system/websocket_test/node_modules/ext/thenable_/finally.js b/system/websocket_test/node_modules/ext/thenable_/finally.js
deleted file mode 100644
index 42274bf..0000000
--- a/system/websocket_test/node_modules/ext/thenable_/finally.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-
-var ensurePlainFunction = require("type/plain-function/ensure")
- , isThenable = require("type/thenable/is")
- , ensureThenable = require("type/thenable/ensure");
-
-var resolveCallback = function (callback, next) {
- var callbackResult = callback();
- if (!isThenable(callbackResult)) return next();
- return callbackResult.then(next);
-};
-
-module.exports = function (callback) {
- ensureThenable(this);
- ensurePlainFunction(callback);
- return this.then(
- function (result) {
- return resolveCallback(callback, function () { return result; });
- },
- function (error) {
- return resolveCallback(callback, function () { throw error; });
- }
- );
-};
diff --git a/system/websocket_test/node_modules/is-typedarray/LICENSE.md b/system/websocket_test/node_modules/is-typedarray/LICENSE.md
deleted file mode 100644
index ee27ba4..0000000
--- a/system/websocket_test/node_modules/is-typedarray/LICENSE.md
+++ /dev/null
@@ -1,18 +0,0 @@
-This software is released under the MIT license:
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/system/websocket_test/node_modules/is-typedarray/README.md b/system/websocket_test/node_modules/is-typedarray/README.md
deleted file mode 100644
index 2752863..0000000
--- a/system/websocket_test/node_modules/is-typedarray/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# is-typedarray [](http://github.com/badges/stability-badges)
-
-Detect whether or not an object is a
-[Typed Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).
-
-## Usage
-
-[](https://nodei.co/npm/is-typedarray/)
-
-### isTypedArray(array)
-
-Returns `true` when array is a Typed Array, and `false` when it is not.
-
-## License
-
-MIT. See [LICENSE.md](http://github.com/hughsk/is-typedarray/blob/master/LICENSE.md) for details.
diff --git a/system/websocket_test/node_modules/is-typedarray/index.js b/system/websocket_test/node_modules/is-typedarray/index.js
deleted file mode 100644
index 5859603..0000000
--- a/system/websocket_test/node_modules/is-typedarray/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-module.exports = isTypedArray
-isTypedArray.strict = isStrictTypedArray
-isTypedArray.loose = isLooseTypedArray
-
-var toString = Object.prototype.toString
-var names = {
- '[object Int8Array]': true
- , '[object Int16Array]': true
- , '[object Int32Array]': true
- , '[object Uint8Array]': true
- , '[object Uint8ClampedArray]': true
- , '[object Uint16Array]': true
- , '[object Uint32Array]': true
- , '[object Float32Array]': true
- , '[object Float64Array]': true
-}
-
-function isTypedArray(arr) {
- return (
- isStrictTypedArray(arr)
- || isLooseTypedArray(arr)
- )
-}
-
-function isStrictTypedArray(arr) {
- return (
- arr instanceof Int8Array
- || arr instanceof Int16Array
- || arr instanceof Int32Array
- || arr instanceof Uint8Array
- || arr instanceof Uint8ClampedArray
- || arr instanceof Uint16Array
- || arr instanceof Uint32Array
- || arr instanceof Float32Array
- || arr instanceof Float64Array
- )
-}
-
-function isLooseTypedArray(arr) {
- return names[toString.call(arr)]
-}
diff --git a/system/websocket_test/node_modules/is-typedarray/package.json b/system/websocket_test/node_modules/is-typedarray/package.json
deleted file mode 100644
index 37f7ae3..0000000
--- a/system/websocket_test/node_modules/is-typedarray/package.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "is-typedarray",
- "version": "1.0.0",
- "description": "Detect whether or not an object is a Typed Array",
- "main": "index.js",
- "scripts": {
- "test": "node test"
- },
- "author": "Hugh Kennedy (http://hughsk.io/)",
- "license": "MIT",
- "dependencies": {},
- "devDependencies": {
- "tape": "^2.13.1"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/hughsk/is-typedarray.git"
- },
- "keywords": [
- "typed",
- "array",
- "detect",
- "is",
- "util"
- ],
- "bugs": {
- "url": "https://github.com/hughsk/is-typedarray/issues"
- },
- "homepage": "https://github.com/hughsk/is-typedarray"
-}
diff --git a/system/websocket_test/node_modules/is-typedarray/test.js b/system/websocket_test/node_modules/is-typedarray/test.js
deleted file mode 100644
index b0c176f..0000000
--- a/system/websocket_test/node_modules/is-typedarray/test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var test = require('tape')
-var ista = require('./')
-
-test('strict', function(t) {
- t.ok(ista.strict(new Int8Array), 'Int8Array')
- t.ok(ista.strict(new Int16Array), 'Int16Array')
- t.ok(ista.strict(new Int32Array), 'Int32Array')
- t.ok(ista.strict(new Uint8Array), 'Uint8Array')
- t.ok(ista.strict(new Uint16Array), 'Uint16Array')
- t.ok(ista.strict(new Uint32Array), 'Uint32Array')
- t.ok(ista.strict(new Float32Array), 'Float32Array')
- t.ok(ista.strict(new Float64Array), 'Float64Array')
-
- t.ok(!ista.strict(new Array), 'Array')
- t.ok(!ista.strict([]), '[]')
-
- t.end()
-})
-
-test('loose', function(t) {
- t.ok(ista.loose(new Int8Array), 'Int8Array')
- t.ok(ista.loose(new Int16Array), 'Int16Array')
- t.ok(ista.loose(new Int32Array), 'Int32Array')
- t.ok(ista.loose(new Uint8Array), 'Uint8Array')
- t.ok(ista.loose(new Uint16Array), 'Uint16Array')
- t.ok(ista.loose(new Uint32Array), 'Uint32Array')
- t.ok(ista.loose(new Float32Array), 'Float32Array')
- t.ok(ista.loose(new Float64Array), 'Float64Array')
-
- t.ok(!ista.loose(new Array), 'Array')
- t.ok(!ista.loose([]), '[]')
-
- t.end()
-})
diff --git a/system/websocket_test/node_modules/ms/index.js b/system/websocket_test/node_modules/ms/index.js
deleted file mode 100644
index 6a522b1..0000000
--- a/system/websocket_test/node_modules/ms/index.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isNaN(val) === false) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtShort(ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtLong(ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
diff --git a/system/websocket_test/node_modules/ms/license.md b/system/websocket_test/node_modules/ms/license.md
deleted file mode 100644
index 69b6125..0000000
--- a/system/websocket_test/node_modules/ms/license.md
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Zeit, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/system/websocket_test/node_modules/ms/package.json b/system/websocket_test/node_modules/ms/package.json
deleted file mode 100644
index 6a31c81..0000000
--- a/system/websocket_test/node_modules/ms/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "ms",
- "version": "2.0.0",
- "description": "Tiny milisecond conversion utility",
- "repository": "zeit/ms",
- "main": "./index",
- "files": [
- "index.js"
- ],
- "scripts": {
- "precommit": "lint-staged",
- "lint": "eslint lib/* bin/*",
- "test": "mocha tests.js"
- },
- "eslintConfig": {
- "extends": "eslint:recommended",
- "env": {
- "node": true,
- "es6": true
- }
- },
- "lint-staged": {
- "*.js": [
- "npm run lint",
- "prettier --single-quote --write",
- "git add"
- ]
- },
- "license": "MIT",
- "devDependencies": {
- "eslint": "3.19.0",
- "expect.js": "0.3.1",
- "husky": "0.13.3",
- "lint-staged": "3.4.1",
- "mocha": "3.4.1"
- }
-}
diff --git a/system/websocket_test/node_modules/ms/readme.md b/system/websocket_test/node_modules/ms/readme.md
deleted file mode 100644
index 84a9974..0000000
--- a/system/websocket_test/node_modules/ms/readme.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# ms
-
-[](https://travis-ci.org/zeit/ms)
-[](https://zeit.chat/)
-
-Use this package to easily convert various time formats to milliseconds.
-
-## Examples
-
-```js
-ms('2 days') // 172800000
-ms('1d') // 86400000
-ms('10h') // 36000000
-ms('2.5 hrs') // 9000000
-ms('2h') // 7200000
-ms('1m') // 60000
-ms('5s') // 5000
-ms('1y') // 31557600000
-ms('100') // 100
-```
-
-### Convert from milliseconds
-
-```js
-ms(60000) // "1m"
-ms(2 * 60000) // "2m"
-ms(ms('10 hours')) // "10h"
-```
-
-### Time format written-out
-
-```js
-ms(60000, { long: true }) // "1 minute"
-ms(2 * 60000, { long: true }) // "2 minutes"
-ms(ms('10 hours'), { long: true }) // "10 hours"
-```
-
-## Features
-
-- Works both in [node](https://nodejs.org) and in the browser.
-- If a number is supplied to `ms`, a string with a unit is returned.
-- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`).
-- If you pass a string with a number and a valid unit, the number of equivalent ms is returned.
-
-## Caught a bug?
-
-1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
-2. Link the package to the global module directory: `npm link`
-3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms!
-
-As always, you can run the tests using: `npm test`
diff --git a/system/websocket_test/node_modules/next-tick/.editorconfig b/system/websocket_test/node_modules/next-tick/.editorconfig
deleted file mode 100644
index bd6d81e..0000000
--- a/system/websocket_test/node_modules/next-tick/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# EditorConfig is awesome: http://EditorConfig.org
-
-# top-most EditorConfig file
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-insert_final_newline = true
-indent_style = tab
-trim_trailing_whitespace = true
-
-[*.md]
-indent_size = 2
-indent_style = space
-trim_trailing_whitespace = false
diff --git a/system/websocket_test/node_modules/next-tick/.github/FUNDING.yml b/system/websocket_test/node_modules/next-tick/.github/FUNDING.yml
deleted file mode 100644
index 270b1dd..0000000
--- a/system/websocket_test/node_modules/next-tick/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-tidelift: "npm/next-tick"
diff --git a/system/websocket_test/node_modules/next-tick/.lint b/system/websocket_test/node_modules/next-tick/.lint
deleted file mode 100644
index ac7ad3a..0000000
--- a/system/websocket_test/node_modules/next-tick/.lint
+++ /dev/null
@@ -1,16 +0,0 @@
-@root
-
-module
-es5
-
-indent 2
-maxlen 100
-tabs
-
-ass
-bitwise
-nomen
-plusplus
-vars
-
-predef+ queueMicrotask, process, setImmediate, setTimeout, clearTimeout, document, MutationObserver, WebKitMutationObserver
diff --git a/system/websocket_test/node_modules/next-tick/CHANGELOG.md b/system/websocket_test/node_modules/next-tick/CHANGELOG.md
deleted file mode 100644
index f990e1c..0000000
--- a/system/websocket_test/node_modules/next-tick/CHANGELOG.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-## [1.1.0](https://github.com/medikoo/next-tick/compare/v1.0.0...v1.1.0) (2020-02-11)
-
-### Features
-
-* Add support for queueMicrotask (Closes [#13](https://github.com/medikoo/next-tick/issues/13)) ([471986e](https://github.com/medikoo/next-tick/commit/471986ee5f7179a498850cc03138a5ed5b9a248c))
-
-## Changelog for previous versions
-
-See `CHANGES` file
diff --git a/system/websocket_test/node_modules/next-tick/CHANGES b/system/websocket_test/node_modules/next-tick/CHANGES
deleted file mode 100644
index 931a8a4..0000000
--- a/system/websocket_test/node_modules/next-tick/CHANGES
+++ /dev/null
@@ -1,28 +0,0 @@
-For recent changelog see CHANGELOG.md
-
------
-
-v1.0.0 -- 2016.06.09
-* In case MutationObserver based solution ensure all callbacks are propagated
- even if any on the way crashes (fixes #3)
-* Support older engines (as IE8) which see typeof setTimeout as 'object'
-* Fix spelling of LICENSE
-* Configure lint scripts
-
-v0.2.2 -- 2014.04.18
-- Do not rely on es5-ext's valid-callable. Replace it with simple internal function
-- In MutationObserver fallback rely on text node instead of attribute and assure
- mutation event is invoked by real change of data
-
-v0.2.1 -- 2014.02.24
-- Fix case in import path
-
-v0.2.0 -- 2014.02.24
-- Assure microtask resultion if MutationObserver is available (thanks @Raynos) #1
-- Unify validation of callback. TypeError is throw for any non callable input
-- Move main module from `lib` to root directory
-- Improve documentation
-- Remove Makefile (it's environment agnostic pacakge)
-
-v0.1.0 -- 2012.08.29
-Initial
diff --git a/system/websocket_test/node_modules/next-tick/LICENSE b/system/websocket_test/node_modules/next-tick/LICENSE
deleted file mode 100644
index cfd3994..0000000
--- a/system/websocket_test/node_modules/next-tick/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2012-2020, Mariusz Nowak, @medikoo, medikoo.com
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/system/websocket_test/node_modules/next-tick/README.md b/system/websocket_test/node_modules/next-tick/README.md
deleted file mode 100644
index 7878e90..0000000
--- a/system/websocket_test/node_modules/next-tick/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# next-tick
-## Environment agnostic nextTick polyfill
-
-To be used in environment agnostic modules that need nextTick functionality.
-
-- When run in Node.js `process.nextTick` is used
-- In modern engines, microtask resolution is guaranteed by `queueMicrotask`
-- In older browsers, `MutationObserver` is used as a fallback
-- In other engines `setImmediate` or `setTimeout(fn, 0)` is used as fallback.
-- If none of the above is supported module resolves to `null`
-
-## Installation
-### NPM
-
-In your project path:
-
- $ npm install next-tick
-
-#### Browser
-
-To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
-
-## Tests [](https://travis-ci.org/medikoo/next-tick)
-
- $ npm test
-
-## Security contact information
-
-To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
-
----
-
-
-
- Get professional support for d with a Tidelift subscription
-
-
-
- Tidelift helps make open source sustainable for maintainers while giving companies assurances about security, maintenance, and licensing for their dependencies.
-
-
diff --git a/system/websocket_test/node_modules/next-tick/index.js b/system/websocket_test/node_modules/next-tick/index.js
deleted file mode 100644
index 4e3b280..0000000
--- a/system/websocket_test/node_modules/next-tick/index.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-var ensureCallable = function (fn) {
- if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
- return fn;
-};
-
-var byObserver = function (Observer) {
- var node = document.createTextNode(''), queue, currentQueue, i = 0;
- new Observer(function () {
- var callback;
- if (!queue) {
- if (!currentQueue) return;
- queue = currentQueue;
- } else if (currentQueue) {
- queue = currentQueue.concat(queue);
- }
- currentQueue = queue;
- queue = null;
- if (typeof currentQueue === 'function') {
- callback = currentQueue;
- currentQueue = null;
- callback();
- return;
- }
- node.data = (i = ++i % 2); // Invoke other batch, to handle leftover callbacks in case of crash
- while (currentQueue) {
- callback = currentQueue.shift();
- if (!currentQueue.length) currentQueue = null;
- callback();
- }
- }).observe(node, { characterData: true });
- return function (fn) {
- ensureCallable(fn);
- if (queue) {
- if (typeof queue === 'function') queue = [queue, fn];
- else queue.push(fn);
- return;
- }
- queue = fn;
- node.data = (i = ++i % 2);
- };
-};
-
-module.exports = (function () {
- // Node.js
- if ((typeof process === 'object') && process && (typeof process.nextTick === 'function')) {
- return process.nextTick;
- }
-
- // queueMicrotask
- if (typeof queueMicrotask === "function") {
- return function (cb) { queueMicrotask(ensureCallable(cb)); };
- }
-
- // MutationObserver
- if ((typeof document === 'object') && document) {
- if (typeof MutationObserver === 'function') return byObserver(MutationObserver);
- if (typeof WebKitMutationObserver === 'function') return byObserver(WebKitMutationObserver);
- }
-
- // W3C Draft
- // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html
- if (typeof setImmediate === 'function') {
- return function (cb) { setImmediate(ensureCallable(cb)); };
- }
-
- // Wide available standard
- if ((typeof setTimeout === 'function') || (typeof setTimeout === 'object')) {
- return function (cb) { setTimeout(ensureCallable(cb), 0); };
- }
-
- return null;
-}());
diff --git a/system/websocket_test/node_modules/next-tick/package.json b/system/websocket_test/node_modules/next-tick/package.json
deleted file mode 100644
index 071c8ac..0000000
--- a/system/websocket_test/node_modules/next-tick/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "next-tick",
- "version": "1.1.0",
- "description": "Environment agnostic nextTick polyfill",
- "author": "Mariusz Nowak (http://www.medikoo.com/)",
- "keywords": [
- "nexttick",
- "setImmediate",
- "setTimeout",
- "async"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/medikoo/next-tick.git"
- },
- "devDependencies": {
- "tad": "^3.0.1",
- "xlint": "^0.2.2",
- "xlint-jslint-medikoo": "^0.1.4"
- },
- "scripts": {
- "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
- "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
- "test": "node node_modules/tad/bin/tad"
- },
- "license": "ISC"
-}
diff --git a/system/websocket_test/node_modules/next-tick/test/index.js b/system/websocket_test/node_modules/next-tick/test/index.js
deleted file mode 100644
index 6b22cf4..0000000
--- a/system/websocket_test/node_modules/next-tick/test/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-
-module.exports = function (t, a, d) {
- var invoked;
-
- a(t(function () {
- a(arguments.length, 0, "Arguments");
- invoked = true;
- }), undefined, "Return");
- a(invoked, undefined, "Is not run immediately");
- setTimeout(function () {
- a(invoked, true, "Run in next tick");
- invoked = [];
- t(function () { invoked.push(0); });
- t(function () { invoked.push(1); });
- t(function () { invoked.push(2); });
- setTimeout(function () {
- a.deep(invoked, [0, 1, 2], "Serial");
- d();
- }, 10);
- }, 10);
-};
diff --git a/system/websocket_test/node_modules/node-gyp-build/LICENSE b/system/websocket_test/node_modules/node-gyp-build/LICENSE
deleted file mode 100644
index 56fce08..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2017 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/system/websocket_test/node_modules/node-gyp-build/README.md b/system/websocket_test/node_modules/node-gyp-build/README.md
deleted file mode 100644
index f712ca6..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# node-gyp-build
-
-> Build tool and bindings loader for [`node-gyp`][node-gyp] that supports prebuilds.
-
-```
-npm install node-gyp-build
-```
-
-[](https://github.com/prebuild/node-gyp-build/actions/workflows/test.yml)
-
-Use together with [`prebuildify`][prebuildify] to easily support prebuilds for your native modules.
-
-## Usage
-
-> **Note.** Prebuild names have changed in [`prebuildify@3`][prebuildify] and `node-gyp-build@4`. Please see the documentation below.
-
-`node-gyp-build` works similar to [`node-gyp build`][node-gyp] except that it will check if a build or prebuild is present before rebuilding your project.
-
-It's main intended use is as an npm install script and bindings loader for native modules that bundle prebuilds using [`prebuildify`][prebuildify].
-
-First add `node-gyp-build` as an install script to your native project
-
-``` js
-{
- ...
- "scripts": {
- "install": "node-gyp-build"
- }
-}
-```
-
-Then in your `index.js`, instead of using the [`bindings`](https://www.npmjs.com/package/bindings) module use `node-gyp-build` to load your binding.
-
-``` js
-var binding = require('node-gyp-build')(__dirname)
-```
-
-If you do these two things and bundle prebuilds with [`prebuildify`][prebuildify] your native module will work for most platforms
-without having to compile on install time AND will work in both node and electron without the need to recompile between usage.
-
-Users can override `node-gyp-build` and force compiling by doing `npm install --build-from-source`.
-
-Prebuilds will be attempted loaded from `MODULE_PATH/prebuilds/...` and then next `EXEC_PATH/prebuilds/...` (the latter allowing use with `zeit/pkg`)
-
-## Supported prebuild names
-
-If so desired you can bundle more specific flavors, for example `musl` builds to support Alpine, or targeting a numbered ARM architecture version.
-
-These prebuilds can be bundled in addition to generic prebuilds; `node-gyp-build` will try to find the most specific flavor first. Prebuild filenames are composed of _tags_. The runtime tag takes precedence, as does an `abi` tag over `napi`. For more details on tags, please see [`prebuildify`][prebuildify].
-
-Values for the `libc` and `armv` tags are auto-detected but can be overridden through the `LIBC` and `ARM_VERSION` environment variables, respectively.
-
-## License
-
-MIT
-
-[prebuildify]: https://github.com/prebuild/prebuildify
-[node-gyp]: https://www.npmjs.com/package/node-gyp
diff --git a/system/websocket_test/node_modules/node-gyp-build/bin.js b/system/websocket_test/node_modules/node-gyp-build/bin.js
deleted file mode 100755
index 3fbcdf0..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/bin.js
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env node
-
-var proc = require('child_process')
-var os = require('os')
-var path = require('path')
-
-if (!buildFromSource()) {
- proc.exec('node-gyp-build-test', function (err, stdout, stderr) {
- if (err) {
- if (verbose()) console.error(stderr)
- preinstall()
- }
- })
-} else {
- preinstall()
-}
-
-function build () {
- var args = [os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']
-
- try {
- var pkg = require('node-gyp/package.json')
- args = [
- process.execPath,
- path.join(require.resolve('node-gyp/package.json'), '..', typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['node-gyp']),
- 'rebuild'
- ]
- } catch (_) {}
-
- proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
- if (code || !process.argv[3]) process.exit(code)
- exec(process.argv[3]).on('exit', function (code) {
- process.exit(code)
- })
- })
-}
-
-function preinstall () {
- if (!process.argv[2]) return build()
- exec(process.argv[2]).on('exit', function (code) {
- if (code) process.exit(code)
- build()
- })
-}
-
-function exec (cmd) {
- if (process.platform !== 'win32') {
- var shell = os.platform() === 'android' ? 'sh' : '/bin/sh'
- return proc.spawn(shell, ['-c', '--', cmd], {
- stdio: 'inherit'
- })
- }
-
- return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], {
- windowsVerbatimArguments: true,
- stdio: 'inherit'
- })
-}
-
-function buildFromSource () {
- return hasFlag('--build-from-source') || process.env.npm_config_build_from_source === 'true'
-}
-
-function verbose () {
- return hasFlag('--verbose') || process.env.npm_config_loglevel === 'verbose'
-}
-
-// TODO (next major): remove in favor of env.npm_config_* which works since npm
-// 0.1.8 while npm_config_argv will stop working in npm 7. See npm/rfcs#90
-function hasFlag (flag) {
- if (!process.env.npm_config_argv) return false
-
- try {
- return JSON.parse(process.env.npm_config_argv).original.indexOf(flag) !== -1
- } catch (_) {
- return false
- }
-}
diff --git a/system/websocket_test/node_modules/node-gyp-build/build-test.js b/system/websocket_test/node_modules/node-gyp-build/build-test.js
deleted file mode 100755
index b6622a5..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/build-test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env node
-
-process.env.NODE_ENV = 'test'
-
-var path = require('path')
-var test = null
-
-try {
- var pkg = require(path.join(process.cwd(), 'package.json'))
- if (pkg.name && process.env[pkg.name.toUpperCase().replace(/-/g, '_')]) {
- process.exit(0)
- }
- test = pkg.prebuild.test
-} catch (err) {
- // do nothing
-}
-
-if (test) require(path.join(process.cwd(), test))
-else require('./')()
diff --git a/system/websocket_test/node_modules/node-gyp-build/index.js b/system/websocket_test/node_modules/node-gyp-build/index.js
deleted file mode 100644
index 07eb14f..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line
-if (typeof runtimeRequire.addon === 'function') { // if the platform supports native resolving prefer that
- module.exports = runtimeRequire.addon.bind(runtimeRequire)
-} else { // else use the runtime version here
- module.exports = require('./node-gyp-build.js')
-}
diff --git a/system/websocket_test/node_modules/node-gyp-build/node-gyp-build.js b/system/websocket_test/node_modules/node-gyp-build/node-gyp-build.js
deleted file mode 100644
index 76b96e1..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/node-gyp-build.js
+++ /dev/null
@@ -1,207 +0,0 @@
-var fs = require('fs')
-var path = require('path')
-var os = require('os')
-
-// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'
-var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line
-
-var vars = (process.config && process.config.variables) || {}
-var prebuildsOnly = !!process.env.PREBUILDS_ONLY
-var abi = process.versions.modules // TODO: support old node where this is undef
-var runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node')
-
-var arch = process.env.npm_config_arch || os.arch()
-var platform = process.env.npm_config_platform || os.platform()
-var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')
-var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''
-var uv = (process.versions.uv || '').split('.')[0]
-
-module.exports = load
-
-function load (dir) {
- return runtimeRequire(load.resolve(dir))
-}
-
-load.resolve = load.path = function (dir) {
- dir = path.resolve(dir || '.')
-
- try {
- var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')
- if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']
- } catch (err) {}
-
- if (!prebuildsOnly) {
- var release = getFirst(path.join(dir, 'build/Release'), matchBuild)
- if (release) return release
-
- var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)
- if (debug) return debug
- }
-
- var prebuild = resolve(dir)
- if (prebuild) return prebuild
-
- var nearby = resolve(path.dirname(process.execPath))
- if (nearby) return nearby
-
- var target = [
- 'platform=' + platform,
- 'arch=' + arch,
- 'runtime=' + runtime,
- 'abi=' + abi,
- 'uv=' + uv,
- armv ? 'armv=' + armv : '',
- 'libc=' + libc,
- 'node=' + process.versions.node,
- process.versions.electron ? 'electron=' + process.versions.electron : '',
- typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line
- ].filter(Boolean).join(' ')
-
- throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n')
-
- function resolve (dir) {
- // Find matching "prebuilds/-" directory
- var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)
- var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]
- if (!tuple) return
-
- // Find most specific flavor first
- var prebuilds = path.join(dir, 'prebuilds', tuple.name)
- var parsed = readdirSync(prebuilds).map(parseTags)
- var candidates = parsed.filter(matchTags(runtime, abi))
- var winner = candidates.sort(compareTags(runtime))[0]
- if (winner) return path.join(prebuilds, winner.file)
- }
-}
-
-function readdirSync (dir) {
- try {
- return fs.readdirSync(dir)
- } catch (err) {
- return []
- }
-}
-
-function getFirst (dir, filter) {
- var files = readdirSync(dir).filter(filter)
- return files[0] && path.join(dir, files[0])
-}
-
-function matchBuild (name) {
- return /\.node$/.test(name)
-}
-
-function parseTuple (name) {
- // Example: darwin-x64+arm64
- var arr = name.split('-')
- if (arr.length !== 2) return
-
- var platform = arr[0]
- var architectures = arr[1].split('+')
-
- if (!platform) return
- if (!architectures.length) return
- if (!architectures.every(Boolean)) return
-
- return { name, platform, architectures }
-}
-
-function matchTuple (platform, arch) {
- return function (tuple) {
- if (tuple == null) return false
- if (tuple.platform !== platform) return false
- return tuple.architectures.includes(arch)
- }
-}
-
-function compareTuples (a, b) {
- // Prefer single-arch prebuilds over multi-arch
- return a.architectures.length - b.architectures.length
-}
-
-function parseTags (file) {
- var arr = file.split('.')
- var extension = arr.pop()
- var tags = { file: file, specificity: 0 }
-
- if (extension !== 'node') return
-
- for (var i = 0; i < arr.length; i++) {
- var tag = arr[i]
-
- if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {
- tags.runtime = tag
- } else if (tag === 'napi') {
- tags.napi = true
- } else if (tag.slice(0, 3) === 'abi') {
- tags.abi = tag.slice(3)
- } else if (tag.slice(0, 2) === 'uv') {
- tags.uv = tag.slice(2)
- } else if (tag.slice(0, 4) === 'armv') {
- tags.armv = tag.slice(4)
- } else if (tag === 'glibc' || tag === 'musl') {
- tags.libc = tag
- } else {
- continue
- }
-
- tags.specificity++
- }
-
- return tags
-}
-
-function matchTags (runtime, abi) {
- return function (tags) {
- if (tags == null) return false
- if (tags.runtime && tags.runtime !== runtime && !runtimeAgnostic(tags)) return false
- if (tags.abi && tags.abi !== abi && !tags.napi) return false
- if (tags.uv && tags.uv !== uv) return false
- if (tags.armv && tags.armv !== armv) return false
- if (tags.libc && tags.libc !== libc) return false
-
- return true
- }
-}
-
-function runtimeAgnostic (tags) {
- return tags.runtime === 'node' && tags.napi
-}
-
-function compareTags (runtime) {
- // Precedence: non-agnostic runtime, abi over napi, then by specificity.
- return function (a, b) {
- if (a.runtime !== b.runtime) {
- return a.runtime === runtime ? -1 : 1
- } else if (a.abi !== b.abi) {
- return a.abi ? -1 : 1
- } else if (a.specificity !== b.specificity) {
- return a.specificity > b.specificity ? -1 : 1
- } else {
- return 0
- }
- }
-}
-
-function isNwjs () {
- return !!(process.versions && process.versions.nw)
-}
-
-function isElectron () {
- if (process.versions && process.versions.electron) return true
- if (process.env.ELECTRON_RUN_AS_NODE) return true
- return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'
-}
-
-function isAlpine (platform) {
- return platform === 'linux' && fs.existsSync('/etc/alpine-release')
-}
-
-// Exposed for unit tests
-// TODO: move to lib
-load.parseTags = parseTags
-load.matchTags = matchTags
-load.compareTags = compareTags
-load.parseTuple = parseTuple
-load.matchTuple = matchTuple
-load.compareTuples = compareTuples
diff --git a/system/websocket_test/node_modules/node-gyp-build/optional.js b/system/websocket_test/node_modules/node-gyp-build/optional.js
deleted file mode 100755
index 8daa04a..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/optional.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-
-/*
-I am only useful as an install script to make node-gyp not compile for purely optional native deps
-*/
-
-process.exit(0)
diff --git a/system/websocket_test/node_modules/node-gyp-build/package.json b/system/websocket_test/node_modules/node-gyp-build/package.json
deleted file mode 100644
index 86319f3..0000000
--- a/system/websocket_test/node_modules/node-gyp-build/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "node-gyp-build",
- "version": "4.8.0",
- "description": "Build tool and bindings loader for node-gyp that supports prebuilds",
- "main": "index.js",
- "devDependencies": {
- "array-shuffle": "^1.0.1",
- "standard": "^14.0.0",
- "tape": "^5.0.0"
- },
- "scripts": {
- "test": "standard && node test"
- },
- "bin": {
- "node-gyp-build": "./bin.js",
- "node-gyp-build-optional": "./optional.js",
- "node-gyp-build-test": "./build-test.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/prebuild/node-gyp-build.git"
- },
- "author": "Mathias Buus (@mafintosh)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/prebuild/node-gyp-build/issues"
- },
- "homepage": "https://github.com/prebuild/node-gyp-build"
-}
diff --git a/system/websocket_test/node_modules/type/CHANGELOG.md b/system/websocket_test/node_modules/type/CHANGELOG.md
deleted file mode 100644
index 001636b..0000000
--- a/system/websocket_test/node_modules/type/CHANGELOG.md
+++ /dev/null
@@ -1,172 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-### [2.7.2](https://github.com/medikoo/type/compare/v2.7.1...v2.7.2) (2022-08-05)
-
-### Maintenance Improvements
-
-- **TS:** Improve `ensure` options handling ([#8](https://github.com/medikoo/type/issues/8)) ([4a54066](https://github.com/medikoo/type/commit/4a54066d7b55cef14ac4aa25a6f070296a043a6f)) ([Marco](https://github.com/borracciaBlu))
-
-### [2.7.1](https://github.com/medikoo/type/compare/v2.7.0...v2.7.1) (2022-08-04)
-
-### Maintenance Improvements
-
-- **TS:** Fix support for `isOptional` in `ensure` options ([#7](https://github.com/medikoo/type/issues/7)) ([320f89b](https://github.com/medikoo/type/commit/320f89b89237e3e0ceff5e26b67cb18bd52cb42d)) ([Marco](https://github.com/borracciaBlu))
-
-## [2.7.0](https://github.com/medikoo/type/compare/v2.6.1...v2.7.0) (2022-08-03)
-
-### Features
-
-- `BigInt.coerce` and `BigInt.ensure` ([e49ad78](https://github.com/medikoo/type/commit/e49ad787bd3aa67b7aa9f7a8ea4cde22a08bebc5))
-
-### [2.6.1](https://github.com/medikoo/type/compare/v2.6.0...v2.6.1) (2022-07-29)
-
-### Maintenance Improvements
-
-- Declare TS types ([#6](https://github.com/medikoo/type/issues/6)) ([6378e2c](https://github.com/medikoo/type/commit/6378e2c457670bcb8a9b898e0f2502ed5b942d44)) ([Marco](https://github.com/borracciaBlu))
-
-## [2.6.0](https://github.com/medikoo/type/compare/v2.5.0...v2.6.0) (2022-02-02)
-
-### Features
-
-- `constructor` validation utils ([74b99bb](https://github.com/medikoo/type/commit/74b99bbf6be27083bf9a053961edb2a585ae3e77))
-
-## [2.5.0](https://github.com/medikoo/type/compare/v2.4.0...v2.5.0) (2021-03-08)
-
-### Features
-
-- `errorCode` option for `ensure*` utils ([777a1f2](https://github.com/medikoo/type/commit/777a1f2c9fd76defcd24d3a30cce49491947fef7))
-
-## [2.4.0](https://github.com/medikoo/type/compare/v2.3.0...v2.4.0) (2021-03-08)
-
-### Features
-
-- `set/is` and `set/ensure` utils ([083ec23](https://github.com/medikoo/type/commit/083ec2351718c310f316dcfd8c624a13201e227f))
-
-## [2.3.0](https://github.com/medikoo/type/compare/v2.2.0...v2.3.0) (2021-02-16)
-
-### Features
-
-- `map/is` and `map/ensure` utils ([aafd1cb](https://github.com/medikoo/type/commit/aafd1cbd8c888fda98d39fd17e59f38b078d7bcf))
-
-## [2.2.0](https://github.com/medikoo/type/compare/v2.1.0...v2.2.0) (2021-02-11)
-
-### Features
-
-- Support `ensureItem` option in `array/ensure` ([8f74973](https://github.com/medikoo/type/commit/8f749739df9bfebf44087093e09c8f7341a33a09))
-
-## [2.1.0](https://github.com/medikoo/type/compare/v2.0.0...v2.1.0) (2020-08-21)
-
-### Features
-
-- `ensure` util for cumulated input validation ([814c5a8](https://github.com/medikoo/type/commit/814c5a801ecac23d06d8a5f4bcafc4763a04408c))
-- Provide an alternative error message with `options.name` ([c7751c0](https://github.com/medikoo/type/commit/c7751c084ee4f3d3ed10500db0edde2ff00e03a1))
-- Support `%n` (meaningful name) token in error message resolver ([b0f374e](https://github.com/medikoo/type/commit/b0f374e54345c714fe37a90887ecfe60577ce133))
-- Support `min` validation for natural numbers ([e703512](https://github.com/medikoo/type/commit/e70351248818d3e113110106ad174b42c5fd9b25))
-- Support custom Error constructors ([c6ecb90](https://github.com/medikoo/type/commit/c6ecb90e21c1c778210934204cbe393fb89ef2f6))
-
-### Bug Fixes
-
-- Fix typo in error message ([2735533](https://github.com/medikoo/type/commit/2735533de28d33dfa13222743698169c92d08c09))
-
-## [2.0.0](https://github.com/medikoo/type/compare/v1.2.0...v2.0.0) (2019-10-10)
-
-### Features
-
-- `allowedKeys` option for plain-object/ensure ([f81e72e](https://github.com/medikoo/type/commit/f81e72e))
-- `ensurePropertyValue` option for plain-object/ensure ([c5ff8fb](https://github.com/medikoo/type/commit/c5ff8fb))
-- Replace `coerceItem` with `ensureItem` option in iterable/ensure ([721494f](https://github.com/medikoo/type/commit/721494f))
-- Seclude lib/resolve-error-message ([12636d9](https://github.com/medikoo/type/commit/12636d9))
-- Validate options.ensureItem in iterable/ensure ([78da6c1](https://github.com/medikoo/type/commit/78da6c1))
-
-### BREAKING CHANGES
-
-- iterable/ensure no longer supports `coerceItem` option. Instead `ensureItem` was introduced
-
-## [1.2.0](https://github.com/medikoo/type/compare/v1.1.0...v1.2.0) (2019-09-20)
-
-### Bug Fixes
-
-- Improve error message so it's not confusing ([97cd6b9](https://github.com/medikoo/type/commit/97cd6b9))
-
-### Features
-
-- 'coerceItem' option for iterable/ensure ([0818860](https://github.com/medikoo/type/commit/0818860))
-
-## [1.1.0](https://github.com/medikoo/type/compare/v1.0.3...v1.1.0) (2019-09-20)
-
-### Features
-
-- `denyEmpty` option for iterables validation ([301d071](https://github.com/medikoo/type/commit/301d071))
-
-### [1.0.3](https://github.com/medikoo/type/compare/v1.0.2...v1.0.3) (2019-08-06)
-
-### Bug Fixes
-
-- Recognize custom built ES5 era errors ([6462fac](https://github.com/medikoo/type/commit/6462fac))
-
-### [1.0.2](https://github.com/medikoo/type/compare/v1.0.1...v1.0.2) (2019-08-06)
-
-### Bug Fixes
-
-- Recognize host errors (e.g. DOMException) ([96ef399](https://github.com/medikoo/type/commit/96ef399))
-
-## [1.0.1](https://github.com/medikoo/type/compare/v1.0.0...v1.0.1) (2019-04-08)
-
-# 1.0.0 (2019-04-05)
-
-### Bug Fixes
-
-- ensure 'is' functions can't crash ([59ceb78](https://github.com/medikoo/type/commit/59ceb78))
-
-### Features
-
-- array-length/coerce ([af8ddec](https://github.com/medikoo/type/commit/af8ddec))
-- array-length/ensure ([d313eb6](https://github.com/medikoo/type/commit/d313eb6))
-- array-like/ensure ([45f1ddd](https://github.com/medikoo/type/commit/45f1ddd))
-- array-like/is ([9a026a5](https://github.com/medikoo/type/commit/9a026a5))
-- array/ensure ([9db1515](https://github.com/medikoo/type/commit/9db1515))
-- array/is ([9672839](https://github.com/medikoo/type/commit/9672839))
-- date/ensure ([44e25a0](https://github.com/medikoo/type/commit/44e25a0))
-- date/is ([0316558](https://github.com/medikoo/type/commit/0316558))
-- ensure to not crash ([3998348](https://github.com/medikoo/type/commit/3998348))
-- ensure/number ([134b5cb](https://github.com/medikoo/type/commit/134b5cb))
-- error/ensure ([d5c8a30](https://github.com/medikoo/type/commit/d5c8a30))
-- error/is-error ([4d6b899](https://github.com/medikoo/type/commit/4d6b899))
-- finite/coerce ([accaad1](https://github.com/medikoo/type/commit/accaad1))
-- finite/ensure ([51e4174](https://github.com/medikoo/type/commit/51e4174))
-- function/ensure ([b624c9a](https://github.com/medikoo/type/commit/b624c9a))
-- function/is ([dab8026](https://github.com/medikoo/type/commit/dab8026))
-- integer/coerce ([89dea2e](https://github.com/medikoo/type/commit/89dea2e))
-- integer/ensure ([44a7071](https://github.com/medikoo/type/commit/44a7071))
-- iterable/ensure ([3d48841](https://github.com/medikoo/type/commit/3d48841))
-- iterable/is ([cf09513](https://github.com/medikoo/type/commit/cf09513))
-- lib/is-to-string-tag-supported ([c8c001d](https://github.com/medikoo/type/commit/c8c001d))
-- natural-number/coerce ([d08fdd9](https://github.com/medikoo/type/commit/d08fdd9))
-- natural-number/ensure ([6c24d12](https://github.com/medikoo/type/commit/6c24d12))
-- number/coerce ([86ccf08](https://github.com/medikoo/type/commit/86ccf08))
-- object/ensure ([a9e8eed](https://github.com/medikoo/type/commit/a9e8eed))
-- object/is ([d2d7251](https://github.com/medikoo/type/commit/d2d7251))
-- plain-function/ensure ([5186518](https://github.com/medikoo/type/commit/5186518))
-- plain-function/is ([51bc791](https://github.com/medikoo/type/commit/51bc791))
-- plain-object/ensure ([91cf5e5](https://github.com/medikoo/type/commit/91cf5e5))
-- plain-object/is ([4dcf393](https://github.com/medikoo/type/commit/4dcf393))
-- promise/ensure ([8d096a4](https://github.com/medikoo/type/commit/8d096a4))
-- promise/is ([a00de02](https://github.com/medikoo/type/commit/a00de02))
-- prototype/is ([b23bdcc](https://github.com/medikoo/type/commit/b23bdcc))
-- reg-exp/ensure ([6f7bbcb](https://github.com/medikoo/type/commit/6f7bbcb))
-- reg-exp/is ([9728519](https://github.com/medikoo/type/commit/9728519))
-- safe-integer/coerce ([b8549c4](https://github.com/medikoo/type/commit/b8549c4))
-- safe-integer/ensure ([a70ef3f](https://github.com/medikoo/type/commit/a70ef3f))
-- string/coerce ([b25c71f](https://github.com/medikoo/type/commit/b25c71f))
-- string/ensure ([b62577d](https://github.com/medikoo/type/commit/b62577d))
-- support 'default' in resolveException ([e08332a](https://github.com/medikoo/type/commit/e08332a))
-- switch config to ES3 based ([37606d9](https://github.com/medikoo/type/commit/37606d9))
-- thenable/ensure ([6762c0d](https://github.com/medikoo/type/commit/6762c0d))
-- thenable/is ([2711d70](https://github.com/medikoo/type/commit/2711d70))
-- time-value/coerce ([27fd109](https://github.com/medikoo/type/commit/27fd109))
-- time-value/ensure ([1f6a8ea](https://github.com/medikoo/type/commit/1f6a8ea))
-- **string/coerce:** restrict toString acceptance ([2a87100](https://github.com/medikoo/type/commit/2a87100))
-- value/ensure ([dd6d8cb](https://github.com/medikoo/type/commit/dd6d8cb))
-- value/is ([fdf4763](https://github.com/medikoo/type/commit/fdf4763))
diff --git a/system/websocket_test/node_modules/type/LICENSE b/system/websocket_test/node_modules/type/LICENSE
deleted file mode 100644
index ce541c9..0000000
--- a/system/websocket_test/node_modules/type/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2019-2022, Mariusz Nowak, @medikoo, medikoo.com
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/system/websocket_test/node_modules/type/README.md b/system/websocket_test/node_modules/type/README.md
deleted file mode 100644
index 6b20794..0000000
--- a/system/websocket_test/node_modules/type/README.md
+++ /dev/null
@@ -1,168 +0,0 @@
-[![Build status][build-image]][build-url]
-[![Tests coverage][cov-image]][cov-url]
-[![npm version][npm-image]][npm-url]
-
-# type
-
-## Runtime validation and processing of JavaScript types
-
-- Respects language nature and acknowledges its quirks
-- Allows coercion in restricted forms (rejects clearly invalid input, normalizes permissible type deviations)
-- No transpilation implied, written to work in all ECMAScript 3+ engines
-
-## Use case
-
-Validate arguments input in public API endpoints.
-
-_For validation of more sophisticated input structures (as deeply nested configuration objects) it's recommended to consider more powerful schema based utlities (as [AJV](https://ajv.js.org/) or [@hapi/joi](https://hapi.dev/family/joi/))_
-
-### Example usage
-
-Bulletproof input arguments normalization and validation:
-
-```javascript
-const ensureString = require('type/string/ensure')
- , ensureDate = require('type/date/ensure')
- , ensureNaturalNumber = require('type/natural-number/ensure')
- , isObject = require('type/object/is');
-
-module.exports = (path, options = { min: 0 }) {
- path = ensureString(path, { errorMessage: "%v is not a path" });
- if (!isObject(options)) options = {};
- const min = ensureNaturalNumber(options.min, { default: 0 })
- , max = ensureNaturalNumber(options.max, { isOptional: true })
- , startTime = ensureDate(options.startTime, { isOptional: true });
-
- // ...logic
-};
-```
-
-### Installation
-
-```bash
-npm install type
-```
-
-## Utilities
-
-Aside of general [`ensure`](docs/ensure.md) validation util, following kind of utilities for recognized JavaScript types are provided:
-
-##### `*/coerce`
-
-Restricted coercion into primitive type. Returns coerced value or `null` if value is not coercible per rules.
-
-##### `*/is`
-
-Object type/kind confirmation, returns either `true` or `false`.
-
-##### `*/ensure`
-
-Value validation. Returns input value (in primitive cases possibly coerced) or if value doesn't meet the constraints throws `TypeError` .
-
-Each `*/ensure` utility, accepts following options (eventually passed with second argument):
-
-- `isOptional` - Makes `null` or `undefined` accepted as valid value. In such case instead of `TypeError` being thrown, `null` is returned.
-- `default` - A value to be returned if `null` or `undefined` is passed as an input value.
-- `errorMessage` - Custom error message. Following placeholders can be used:
- - `%v` - To be replaced with short string representation of invalid value
- - `%n` - To be replaced with meaninfgul name (to be passed with `name` option) of validated value. Not effective if `name` option is not present
-- `errorCode` - Eventual error code to be exposed on `.code` error property
-- `name` - Meaningful name for validated value, to be used in error message, assuming it contains `%n` placeholder
-- `Error` - Alternative error constructor to be used (defaults to `TypeError`)
-
-### Index
-
-#### General utils:
-
-- [`ensure`](docs/ensure.md)
-
-#### Type specific utils:
-
-- **Value**
- - [`value/is`](docs/value.md#valueis)
- - [`value/ensure`](docs/value.md#valueensure)
-- **Object**
- - [`object/is`](docs/object.md#objectis)
- - [`object/ensure`](docs/object.md#objectensure)
- - **Plain Object**
- - [`plain-object/is`](docs/plain-object.md#plain-objectis)
- - [`plain-object/ensure`](docs/plain-object.md#plain-objectensure)
-- **String**
- - [`string/coerce`](docs/string.md#stringcoerce)
- - [`string/ensure`](docs/string.md#stringensure)
-- **Number**
- - [`number/coerce`](docs/number.md#numbercoerce)
- - [`number/ensure`](docs/number.md#numberensure)
- - **Finite Number**
- - [`finite/coerce`](docs/finite.md#finitecoerce)
- - [`finite/ensure`](docs/finite.md#finiteensure)
- - **Integer Number**
- - [`integer/coerce`](docs/integer.md#integercoerce)
- - [`integer/ensure`](docs/integer.md#integerensure)
- - **Safe Integer Number**
- - [`safe-integer/coerce`](docs/safe-integer.md#safe-integercoerce)
- - [`safe-integer/ensure`](docs/.md#safe-integerensure)
- - **Natural Number**
- - [`natural-number/coerce`](docs/natural-number.md#natural-numbercoerce)
- - [`natural-number/ensure`](docs/natural-number.md#natural-numberensure)
- - **Array Length**
- - [`array-length/coerce`](docs/array-length.md#array-lengthcoerce)
- - [`array-length/ensure`](docs/array-length.md#array-lengthensure)
- - **Time Value**
- - [`time-value/coerce`](docs/time-value.md#time-valuecoerce)
- - [`time-value/ensure`](docs/time-value.md#time-valueensure)
-- **BigInt**
- - [`big-int/coerce`](docs/big-int.md#big-intcoerce)
- - [`big-int/ensure`](docs/big-int.md#big-intensure)
-- **Array Like**
- - [`array-like/is`](docs/array-like.md#array-likeis)
- - [`array-like/ensure`](docs/array-like.md#array-likeensure)
- - **Array**
- - [`array/is`](docs/array.md#arrayis)
- - [`array/ensure`](docs/array.md#arrayensure)
-- **Iterable**
- - [`iterable/is`](docs/iterable.md#iterableis)
- - [`iterable/ensure`](docs/iterable.md#iterableensure)
-- **Set**
- - [`set/is`](docs/set.md#setis)
- - [`set/ensure`](docs/set.md#setensure)
-- **Map**
- - [`map/is`](docs/map.md#mapis)
- - [`map/ensure`](docs/map.md#mapensure)
-- **Date**
- - [`date/is`](docs/date.md#dateis)
- - [`date/ensure`](docs/date.md#dateensure)
-- **Function**
- - [`function/is`](docs/function.md#functionis)
- - [`function/ensure`](docs/function.md#functionensure)
- - **Constructor**
- - [`constructor/is`](docs/constructor.md#plain-functionis)
- - [`constructor/ensure`](docs/constructor.md#plain-functionensure)
- - **Plain Function**
- - [`plain-function/is`](docs/plain-function.md#plain-functionis)
- - [`plain-function/ensure`](docs/plain-function.md#plain-functionensure)
-- **Reg Exp**
- - [`reg-exp/is`](docs/reg-exp.md#reg-expis)
- - [`reg-exp/ensure`](docs/.md#reg-expensure)
-- **Thenable**
- - [`thenable/is`](docs/thenable.md#thenableis)
- - [`thenable/ensure`](docs/thenable.md#thenableensure)
- - **Promise**
- - [`promise/is`](docs/promise.md#promiseis)
- - [`promise/ensure`](docs/promise.md#promiseensure)
-- **Error**
- - [`error/is`](docs/error.md#erroris)
- - [`error/ensure`](docs/error.md#errorensure)
-- **Prototype**
- - [`prototype/is`](docs/prototype.md#prototypeis)
-
-### Tests
-
- $ npm test
-
-[build-image]: https://github.com/medikoo/type/workflows/Integrate/badge.svg
-[build-url]: https://github.com/medikoo/type/actions?query=workflow%3AIntegrate
-[cov-image]: https://img.shields.io/codecov/c/github/medikoo/type.svg
-[cov-url]: https://codecov.io/gh/medikoo/type
-[npm-image]: https://img.shields.io/npm/v/type.svg
-[npm-url]: https://www.npmjs.com/package/type
diff --git a/system/websocket_test/node_modules/type/array-length/coerce.js b/system/websocket_test/node_modules/type/array-length/coerce.js
deleted file mode 100644
index 3dbbf97..0000000
--- a/system/websocket_test/node_modules/type/array-length/coerce.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-var coerceToSafeInteger = require("../safe-integer/coerce");
-
-module.exports = function (value) {
- value = coerceToSafeInteger(value);
- if (!value) return value;
- if (value < 0) return null;
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/array-length/ensure.js b/system/websocket_test/node_modules/type/array-length/ensure.js
deleted file mode 100644
index 2b48ddc..0000000
--- a/system/websocket_test/node_modules/type/array-length/ensure.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected an array length for %n, received %v"
- : "%v is not an array length";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/array-like/ensure.js b/system/websocket_test/node_modules/type/array-like/ensure.js
deleted file mode 100644
index 0d1a9f7..0000000
--- a/system/websocket_test/node_modules/type/array-like/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value, arguments[1])) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected an array like for %n, received %v"
- : "%v is not an array like";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/array-like/is.js b/system/websocket_test/node_modules/type/array-like/is.js
deleted file mode 100644
index 7778fed..0000000
--- a/system/websocket_test/node_modules/type/array-like/is.js
+++ /dev/null
@@ -1,21 +0,0 @@
-"use strict";
-
-var coerceToArrayLength = require("../array-length/coerce")
- , isObject = require("../object/is");
-
-module.exports = function (value/*, options*/) {
- if (!isObject(value)) {
- var options = arguments[1];
- if (isObject(options) && options.allowString && typeof value === "string") return true;
- return false;
- }
-
- if (typeof value === "function") return false;
-
- var length;
- try { length = value.length; }
- catch (error) { return false; }
-
- if (coerceToArrayLength(length) === null) return false;
- return true;
-};
diff --git a/system/websocket_test/node_modules/type/array/ensure.js b/system/websocket_test/node_modules/type/array/ensure.js
deleted file mode 100644
index 19e4599..0000000
--- a/system/websocket_test/node_modules/type/array/ensure.js
+++ /dev/null
@@ -1,43 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , resolveErrorMessage = require("../lib/resolve-error-message")
- , toShortString = require("../lib/to-short-string")
- , ensurePlainFunction = require("../plain-function/ensure")
- , is = require("./is");
-
-var objHasOwnProperty = Object.prototype.hasOwnProperty, invalidItemsLimit = 3;
-
-module.exports = function (value /*, options*/) {
- var options = arguments[1];
- var mainErrorMessage =
- options && options.name ? "Expected an array for %n, received %v" : "%v is not an array";
- if (!is(value)) return resolveException(value, mainErrorMessage, options);
- if (!options) return value;
-
- var ensureItem = ensurePlainFunction(options.ensureItem, { isOptional: true });
- if (ensureItem) {
- var coercedValue = [], invalidItems;
- for (var index = 0, length = value.length; index < length; ++index) {
- if (!objHasOwnProperty.call(value, index)) continue;
- var coercedItem;
- try {
- coercedItem = ensureItem(value[index]);
- } catch (error) {
- if (!invalidItems) invalidItems = [];
- if (invalidItems.push(toShortString(value[index])) === invalidItemsLimit) break;
- }
- if (invalidItems) continue;
- coercedValue[index] = coercedItem;
- }
- if (invalidItems) {
- throw new TypeError(
- resolveErrorMessage(mainErrorMessage, value, options) +
- ".\n Following items are invalid: " +
- invalidItems.join(", ")
- );
- }
- return coercedValue;
- }
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/array/is.js b/system/websocket_test/node_modules/type/array/is.js
deleted file mode 100644
index 13fd8d3..0000000
--- a/system/websocket_test/node_modules/type/array/is.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-var isArray;
-if (typeof Array.isArray === "function") {
- isArray = Array.isArray;
-} else {
- var objectToString = Object.prototype.toString, objectTaggedString = objectToString.call([]);
- isArray = function (value) { return objectToString.call(value) === objectTaggedString; };
-}
-
-module.exports = function (value) {
- if (!isArray(value)) return false;
-
- // Sanity check (reject objects which do not expose common Array interface)
- if (!hasOwnProperty.call(value, "length")) return false;
- try {
- if (typeof value.length !== "number") return false;
- if (typeof value.push !== "function") return false;
- if (typeof value.splice !== "function") return false;
- } catch (error) {
- return false;
- }
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/big-int/coerce.js b/system/websocket_test/node_modules/type/big-int/coerce.js
deleted file mode 100644
index a600a20..0000000
--- a/system/websocket_test/node_modules/type/big-int/coerce.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var isValue = require("../value/is");
-
-// Sanity BigInt support check
-BigInt(0);
-
-module.exports = function (value) {
- if (!isValue(value)) return null;
- if (typeof value === "bigint") return value;
- try { return BigInt(value); }
- catch (error) { return null; }
-};
diff --git a/system/websocket_test/node_modules/type/big-int/ensure.js b/system/websocket_test/node_modules/type/big-int/ensure.js
deleted file mode 100644
index 319b1b7..0000000
--- a/system/websocket_test/node_modules/type/big-int/ensure.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value /*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected bigint for %n, received %v" : "%v is not a bigint";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/constructor/ensure.js b/system/websocket_test/node_modules/type/constructor/ensure.js
deleted file mode 100644
index 4f3e846..0000000
--- a/system/websocket_test/node_modules/type/constructor/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value /*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a constructor function for %n, received %v"
- : "%v is not a constructor function";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/constructor/is.js b/system/websocket_test/node_modules/type/constructor/is.js
deleted file mode 100644
index 058a156..0000000
--- a/system/websocket_test/node_modules/type/constructor/is.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var isFunction = require("../function/is");
-
-var constructorRe = /^\s*(?:class[\s{/}]|function[\s(])/
- , functionToString = Function.prototype.toString;
-
-module.exports = function (value) {
- if (!isFunction(value)) return false;
- if (!constructorRe.test(functionToString.call(value))) return false;
- return true;
-};
diff --git a/system/websocket_test/node_modules/type/date/ensure.js b/system/websocket_test/node_modules/type/date/ensure.js
deleted file mode 100644
index 0fae4d3..0000000
--- a/system/websocket_test/node_modules/type/date/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a date for %n, received %v" : "%v is not a date";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/date/is.js b/system/websocket_test/node_modules/type/date/is.js
deleted file mode 100644
index 0754085..0000000
--- a/system/websocket_test/node_modules/type/date/is.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-var dateValueOf = Date.prototype.valueOf;
-
-module.exports = function (value) {
- if (!value) return false;
-
- try {
- // Sanity check (reject objects which do not expose common Date interface)
- if (typeof value.getFullYear !== "function") return false;
- if (typeof value.getTimezoneOffset !== "function") return false;
- if (typeof value.setFullYear !== "function") return false;
-
- // Ensure its native Date object (has [[DateValue]] slot)
- dateValueOf.call(value);
- } catch (error) {
- return false;
- }
-
- // Ensure it hosts valid date
- if (isNaN(value)) return false;
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/docs/array-length.md b/system/websocket_test/node_modules/type/docs/array-length.md
deleted file mode 100644
index cca7d8a..0000000
--- a/system/websocket_test/node_modules/type/docs/array-length.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Array length
-
-_number_ primitive that conforms as valid _array length_
-
-## `array-length/coerce`
-
-Follows [`safe-integer/coerce`](safe-integer.md#safe-integercoerce) but returns `null` in place of values which are below `0`
-
-```javascript
-const coerceToArrayLength = require("type/safe-integer/coerce");
-
-coerceToArrayLength("12.95"); // 12
-coerceToArrayLength(9007199254740992); // null
-coerceToArrayLength(null); // null
-```
-
-## `array-length/ensure`
-
-If given argument is an _array length_ coercible value (via [`array-length/coerce`](#array-lengthcoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureArrayLength = require("type/array-length/ensure");
-
-ensureArrayLength(12.93); // "12"
-ensureArrayLength(9007199254740992); // Thrown TypeError: 9007199254740992 is not a valid array length
-```
diff --git a/system/websocket_test/node_modules/type/docs/array-like.md b/system/websocket_test/node_modules/type/docs/array-like.md
deleted file mode 100644
index 2a48df8..0000000
--- a/system/websocket_test/node_modules/type/docs/array-like.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Array Like
-
-_Array-like_ value (any value with `length` property)
-
-## `array-like/is`
-
-Restricted _array-like_ confirmation. Returns true for every value that meets following contraints
-
-- is an _object_ (or with `allowString` option, a _string_)
-- is not a _function_
-- Exposes `length` that meets [`array-length`](array-length.md#array-lengthcoerce) constraints
-
-```javascript
-const isArrayLike = require("type/array-like/is");
-
-isArrayLike([]); // true
-isArrayLike({}); // false
-isArrayLike({ length: 0 }); // true
-isArrayLike("foo"); // false
-isArrayLike("foo", { allowString: true }); // true
-```
-
-## `array-like/ensure`
-
-If given argument is an _array-like_, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureArrayLike = require("type/array-like/ensure");
-
-ensureArrayLike({ length: 0 }); // { length: 0 }
-ensureArrayLike("foo", { allowString: true }); // "foo"
-ensureArrayLike({}); // Thrown TypeError: null is not an iterable
-```
diff --git a/system/websocket_test/node_modules/type/docs/array.md b/system/websocket_test/node_modules/type/docs/array.md
deleted file mode 100644
index 0c6ac4e..0000000
--- a/system/websocket_test/node_modules/type/docs/array.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Array
-
-_Array_ instance
-
-## `array/is`
-
-Confirms if given object is a native array
-
-```javascript
-const isArray = require("type/array/is");
-
-isArray([]); // true
-isArray({}); // false
-isArray("foo"); // false
-```
-
-## `array/ensure`
-
-If given argument is an array, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureArray = require("type/array/ensure");
-
-ensureArray(["foo"]); // ["foo"]
-ensureArray("foo"); // Thrown TypeError: foo is not an array
-```
-
-### Confirming on items
-
-Items can be validated by passing `ensureItem` option. Note that in this case:
-
-- A newly created instance of an array with coerced item values is returned
-- Error message lists up to three items which are invalid
-
-```javascript
-const ensureString = require("type/string/ensure");
-
-ensureArray([12], { ensureItem: ensureString }); // ["12"]
-
-/*
- Below invocation with crash with:
- TypeError: 23, [object Object], [object Object] is not a valid array.
- Following items are invalid: [object Object], [object Object]
-*/
-ensureArray([23, {}, {}], { ensureItem: ensureString });
-```
diff --git a/system/websocket_test/node_modules/type/docs/big-int.md b/system/websocket_test/node_modules/type/docs/big-int.md
deleted file mode 100644
index 78626fd..0000000
--- a/system/websocket_test/node_modules/type/docs/big-int.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# BigInt
-
-_bigint_ primitive
-
-## `big-int/coerce`
-
-BigInt coercion. If value can be coerced by `BigInt` its result is returned.
-For all other values `null` is returned
-
-```javascript
-const coerceToBigInt = require("type/big-int/coerce");
-
-coerceToBigInt(12); // 12n
-coerceToBigInt(undefined); // null
-```
-
-## `big-int/ensure`
-
-If given argument is a _bigint_ coercible value (via [`big-int/coerce`](#big-intcoerce)) returns result bigint.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureBigInt = require("type/big-int/ensure");
-
-ensureBigInt(12); // 12n
-ensureBigInt(null); // Thrown TypeError: null is not a bigint
-```
diff --git a/system/websocket_test/node_modules/type/docs/constructor.md b/system/websocket_test/node_modules/type/docs/constructor.md
deleted file mode 100644
index 172462a..0000000
--- a/system/websocket_test/node_modules/type/docs/constructor.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Constructor
-
-A _Function_ instance that's a _constructor_ (either regular function or _class_)
-
-## `constructor/is`
-
-Confirms if given object is a constructor function\_
-
-```javascript
-const isConstructor = require("type/constructor/is");
-
-isConstructor(function () {}); // true
-isConstructor(() => {}); // false
-isConstructor(class {}); // true
-isConstructor("foo"); // false
-```
-
-## `constructor/ensure`
-
-If given argument is a _constructor function_, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureConstructor = require("type/constructor/ensure");
-
-const fn = function () {};
-ensureConstructor(fn); // fn
-ensureConstructor(() => {}); // Thrown TypeError: () => {} is not a constructor function
-```
diff --git a/system/websocket_test/node_modules/type/docs/date.md b/system/websocket_test/node_modules/type/docs/date.md
deleted file mode 100644
index 98d3654..0000000
--- a/system/websocket_test/node_modules/type/docs/date.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Date
-
-_Date_ instance
-
-## `date/is`
-
-Confirms if given object is a native date, and is not an _Invalid Date_
-
-```javascript
-const isDate = require("type/date/is");
-
-isDate(new Date()); // true
-isDate(new Date("Invalid date")); // false
-isDate(Date.now()); // false
-isDate("foo"); // false
-```
-
-## `date/ensure`
-
-If given argument is a date object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureDate = require("type/date/ensure");
-
-const date = new Date();
-ensureDate(date); // date
-ensureDate(123123); // Thrown TypeError: 123123 is not a date object
-```
diff --git a/system/websocket_test/node_modules/type/docs/ensure.md b/system/websocket_test/node_modules/type/docs/ensure.md
deleted file mode 100644
index c3a9527..0000000
--- a/system/websocket_test/node_modules/type/docs/ensure.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# `ensure(validationDatum1[, ...validationDatumN[, options]])`
-
-Provides a complete cumulated input validation for an API endpoint. Validates multiple input arguments and consolidates eventual errors into one.
-
-## Arguments
-
-### `validationDatum1[, ...validationDatumN]`
-
-For each argument to be validated a `validationDatum` of following stucture should be defined:
-
-```javascript
-[argumentName, inputValue, ensureFunction, (options = {})];
-```
-
-- `argumentName` - Name of validated argument (used for meaningful error messaging)
-- `inputValue` - An argument value as passed to function
-- `ensureFunction` - An `ensureX` function with which argument should be validated (e.g. if we're after string, then we need [string/ensure](string.md#stringensure))
-- `options` - Optional, extra options to be passed to `ensureX` function
-
-### `[options]`
-
-Eventual options be passed to underlying `ensureX` functions. If custom error constructor is passed with an `Error` option, then cumulated error is created with this constructor.
-
-## Usage example
-
-```javascript
-const ensure = require("type/ensure");
-const ensureString = require("type/string/ensure");
-const ensureNaturalNumber = require("type/natural-number/ensure");
-
-const resolveRepositoryIssue = (repoName, issueNumber) => {
- // Validate input
- [repoName, issueNumber] = ensure(
- ["repoName", repoName, ensureString],
- ["issueNumber", issueNumber, ensureNaturalNumber],
- { Error: UserError }
- );
- // ... logic
-};
-```
diff --git a/system/websocket_test/node_modules/type/docs/error.md b/system/websocket_test/node_modules/type/docs/error.md
deleted file mode 100644
index c779333..0000000
--- a/system/websocket_test/node_modules/type/docs/error.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# Error
-
-_Error_ instance
-
-## `error/is`
-
-Confirms if given object is a native error object
-
-```javascript
-const isError = require("type/error/is");
-
-isError(new Error()); // true
-isError({ message: "Fake error" }); // false
-```
-
-## `error/ensure`
-
-If given argument is an error object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureError = require("type/error/ensure");
-
-const someError = new Error("Some error");
-ensureError(someError); // someError
-ensureError({ message: "Fake error" }); // Thrown TypeError: [object Object] is not an error object
-```
diff --git a/system/websocket_test/node_modules/type/docs/finite.md b/system/websocket_test/node_modules/type/docs/finite.md
deleted file mode 100644
index 68786ca..0000000
--- a/system/websocket_test/node_modules/type/docs/finite.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Finite Number
-
-Finite _number_ primitive
-
-## `finite/coerce`
-
-Follows [`number/coerce`](number.md#numbercoerce) additionally rejecting `Infinity` and `-Infinity` values (`null` is returned if given values coerces to them)
-
-```javascript
-const coerceToFinite = require("type/finite/coerce");
-
-coerceToFinite("12"); // 12
-coerceToFinite(Infinity); // null
-coerceToFinite(null); // null
-```
-
-## `finite/ensure`
-
-If given argument is a finite number coercible value (via [`finite/coerce`](#finitecoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureFinite = require("type/finite/ensure");
-
-ensureFinite(12); // "12"
-ensureFinite(null); // Thrown TypeError: null is not a finite number
-```
diff --git a/system/websocket_test/node_modules/type/docs/function.md b/system/websocket_test/node_modules/type/docs/function.md
deleted file mode 100644
index 23f3827..0000000
--- a/system/websocket_test/node_modules/type/docs/function.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Function
-
-_Function_ instance
-
-## `function/is`
-
-Confirms if given object is a native function
-
-```javascript
-const isFunction = require("type/function/is");
-
-isFunction(function () {}); // true
-isFunction(() => {}); // true
-isFunction(class {}); // true
-isFunction("foo"); // false
-```
-
-## `function/ensure`
-
-If given argument is a function object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureFunction = require("type/function/ensure");
-
-const fn = function () {};
-ensureFunction(fn); // fn
-ensureFunction(/foo/); // Thrown TypeError: /foo/ is not a function
-```
diff --git a/system/websocket_test/node_modules/type/docs/integer.md b/system/websocket_test/node_modules/type/docs/integer.md
deleted file mode 100644
index 9260a46..0000000
--- a/system/websocket_test/node_modules/type/docs/integer.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Integer Number
-
-Integer _number_ primitive
-
-## `integer/coerce`
-
-Follows [`finite/coerce`](finite.md#finitecoerce) additionally stripping decimal part from the number
-
-```javascript
-const coerceToInteger = require("type/integer/coerce");
-
-coerceToInteger("12.95"); // 12
-coerceToInteger(Infinity); // null
-coerceToInteger(null); // null
-```
-
-## `integer/ensure`
-
-If given argument is an integer coercible value (via [`integer/coerce`](#integercoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureInteger = require("type/integer/ensure");
-
-ensureInteger(12.93); // "12"
-ensureInteger(null); // Thrown TypeError: null is not an integer
-```
diff --git a/system/websocket_test/node_modules/type/docs/iterable.md b/system/websocket_test/node_modules/type/docs/iterable.md
deleted file mode 100644
index 862e6c8..0000000
--- a/system/websocket_test/node_modules/type/docs/iterable.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Iterable
-
-Value which implements _iterable_ protocol
-
-## `iterable/is`
-
-Confirms if given object is an _iterable_ and is not a _string_ (unless `allowString` option is passed)
-
-```javascript
-const isIterable = require("type/iterable/is");
-
-isIterable([]); // true
-isIterable({}); // false
-isIterable("foo"); // false
-isIterable("foo", { allowString: true }); // true
-```
-
-Supports also `denyEmpty` option
-
-```javascript
-isIterable([], { denyEmpty: true }); // false
-isIterable(["foo"], { denyEmpty: true }); // true
-```
-
-## `iterable/ensure`
-
-If given argument is an _iterable_, it is returned back. Otherwise `TypeError` is thrown.
-By default _string_ primitives are rejected unless `allowString` option is passed.
-
-```javascript
-const ensureIterable = require("type/iterable/ensure");
-
-ensureIterable([]); // []
-ensureIterable("foo", { allowString: true }); // "foo"
-ensureIterable({}); // Thrown TypeError: null is not expected iterable
-```
-
-### Denying empty iterables
-
-Pass `denyEmpty` option to require non empty iterables
-
-```javascript
-ensureIterable([], { denyEmpty: true }); // Thrown TypeError: [] is not expected iterable
-```
-
-### Confirming on items
-
-Items can be validated by passing `ensureItem` option. Note that in this case:
-
-- A newly created instance of array with coerced values is returned
-- Error message lists up to three invalid items
-
-```javascript
-const ensureString = require("type/string/ensure");
-
-ensureIterable(new Set(["foo", 12]), { ensureItem: ensureString }); // ["foo", "12"]
-
-/*
- Below invocation with crash with:
- TypeError: [object Set] is not expected iterable value.
- Following items are invalid:
- - [object Object]
-*/
-ensureIterable(new Set(["foo", {}]), { ensureItem: ensureString });
-```
diff --git a/system/websocket_test/node_modules/type/docs/map.md b/system/websocket_test/node_modules/type/docs/map.md
deleted file mode 100644
index c128022..0000000
--- a/system/websocket_test/node_modules/type/docs/map.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Map
-
-_Map_ instance
-
-## `map/is`
-
-Confirms if given object is a native _map_
-
-```javascript
-const isMap = require("type/map/is");
-
-isMap(new Map()); // true
-isMap(new Set()); // false
-isMap({}); // false
-```
-
-## `map/ensure`
-
-If given argument is a _map_, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureMap = require("type/map/ensure");
-
-const map = new Map();
-ensureMap(map); // map
-eensureMap({}); // Thrown TypeError: [object Object] is not a map
-```
diff --git a/system/websocket_test/node_modules/type/docs/natural-number.md b/system/websocket_test/node_modules/type/docs/natural-number.md
deleted file mode 100644
index c91ee16..0000000
--- a/system/websocket_test/node_modules/type/docs/natural-number.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Natural Number
-
-Natural _number_ primitive
-
-## `natural-number/coerce`
-
-Follows [`integer/coerce`](integer.md#integercoerce) but returns `null` for values below `0`
-
-```javascript
-const coerceToNaturalNumber = require("type/natural-number/coerce");
-
-coerceToNaturalNumber("12.95"); // 12
-coerceToNaturalNumber(-120); // null
-coerceToNaturalNumber(null); // null
-```
-
-## `natural-number/ensure`
-
-If given argument is a natural number coercible value (via [`natural-number/coerce`](#natural-numbercoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureNaturalNumber = require("type/natural-number/ensure");
-
-ensureNaturalNumber(12.93); // "12"
-ensureNaturalNumber(-230); // Thrown TypeError: null is not a natural number
-```
diff --git a/system/websocket_test/node_modules/type/docs/number.md b/system/websocket_test/node_modules/type/docs/number.md
deleted file mode 100644
index 5f4dfa9..0000000
--- a/system/websocket_test/node_modules/type/docs/number.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Number
-
-_number_ primitive
-
-## `number/coerce`
-
-Restricted number coercion. Returns number presentation for every value that follows below constraints
-
-- is implicitly coercible to number
-- is neither `null` nor `undefined`
-- is not `NaN` and doesn't coerce to `NaN`
-
-For all other values `null` is returned
-
-```javascript
-const coerceToNumber = require("type/number/coerce");
-
-coerceToNumber("12"); // 12
-coerceToNumber({}); // null
-coerceToNumber(null); // null
-```
-
-## `number/ensure`
-
-If given argument is a number coercible value (via [`number/coerce`](#numbercoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureNumber = require("type/number/ensure");
-
-ensureNumber(12); // "12"
-ensureNumber(null); // Thrown TypeError: null is not a number
-```
diff --git a/system/websocket_test/node_modules/type/docs/object.md b/system/websocket_test/node_modules/type/docs/object.md
deleted file mode 100644
index ed43b1f..0000000
--- a/system/websocket_test/node_modules/type/docs/object.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Object
-
-_Object_, any non-primitive value
-
-## `object/is`
-
-Confirms if passed value is an object
-
-```javascript
-const isObject = require("type/object/is");
-
-isObject({}); // true
-isObject(true); // false
-isObject(null); // false
-```
-
-## `object/ensure`
-
-If given argument is an object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureObject = require("type/object/ensure");
-
-const obj = {};
-
-ensureObject(obj); // obj
-ensureString(null); // Thrown TypeError: null is not an object
-```
diff --git a/system/websocket_test/node_modules/type/docs/plain-function.md b/system/websocket_test/node_modules/type/docs/plain-function.md
deleted file mode 100644
index e3a8895..0000000
--- a/system/websocket_test/node_modules/type/docs/plain-function.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Plain Function
-
-A _Function_ instance that is not a _Class_
-
-## `plain-function/is`
-
-Confirms if given object is a _plain function_
-
-```javascript
-const isPlainFunction = require("type/plain-function/is");
-
-isPlainFunction(function () {}); // true
-isPlainFunction(() => {}); // true
-isPlainFunction(class {}); // false
-isPlainFunction("foo"); // false
-```
-
-## `plain-function/ensure`
-
-If given argument is a _plain function_ object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensurePlainFunction = require("type/function/ensure");
-
-const fn = function () {};
-ensurePlainFunction(fn); // fn
-ensurePlainFunction(class {}); // Thrown TypeError: class is not a plain function
-```
diff --git a/system/websocket_test/node_modules/type/docs/plain-object.md b/system/websocket_test/node_modules/type/docs/plain-object.md
deleted file mode 100644
index ce3f522..0000000
--- a/system/websocket_test/node_modules/type/docs/plain-object.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Plain Object
-
-A _plain object_
-
-- Inherits directly from `Object.prototype` or `null`
-- Is not a constructor's `prototype` property
-
-## `plain-object/is`
-
-Confirms if given object is a _plain object_
-
-```javascript
-const isPlainObject = require("type/plain-object/is");
-
-isPlainObject({}); // true
-isPlainObject(Object.create(null)); // true
-isPlainObject([]); // false
-```
-
-## `plain-object/ensure`
-
-If given argument is a plain object it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensurePlainObject = require("type/plain-object/ensure");
-
-ensurePlainObject({}); // {}
-ensurePlainObject("foo"); // Thrown TypeError: foo is not a plain object
-```
-
-### Confirming on keys
-
-Keys can be validated by passing `allowedKeys` option. Note that in this case:
-
-- Error message lists up to three invalid keys
-
-```javascript
-const allowedKeys = ["foo"];
-
-ensurePlainObject({}, { allowedKeys }); // {}
-ensurePlainObject({ foo: "bar" }, { allowedKeys }); // { foo: 'bar' }
-
-/*
- Below invocation with crash with:
- TypeError: [object Object] is not a valid plain object.
- Following keys are unexpected: lorem, ipsum
-*/
-ensurePlainObject({ foo: "bar", lorem: 1, ipsum: 2 }, { allowedKeys });
-```
-
-### Confirming on property values
-
-Property values can be validated by passing `ensurePropertyValue` option. Note that in this case:
-
-- A newly created instance of plain object with coerced values is returned
-- Error message lists up to three keys that contain invalid values
-
-```javascript
-const ensureString = require("type/string/ensure");
-
-ensurePlainObject({ foo: 12 }, { ensurePropertyValue: ensureString }); // { foo: '12' }
-
-/*
- Below invocation with crash with:
- TypeError: [object Object] is not a valid plain object.
- Valuees for following keys are invalid: lorem, ipsum
-*/
-ensurePlainObject({ foo: 23, lorem: {}, ipsum: {} }, { ensurePropertyValue: ensureString });
-```
diff --git a/system/websocket_test/node_modules/type/docs/promise.md b/system/websocket_test/node_modules/type/docs/promise.md
deleted file mode 100644
index ce38794..0000000
--- a/system/websocket_test/node_modules/type/docs/promise.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Promise
-
-_Promise_ instance
-
-## `promise/is`
-
-Confirms if given object is a native _promise_
-
-```javascript
-const isPromise = require("type/promise/is");
-
-isPromise(Promise.resolve()); // true
-isPromise({ then: () => {} }); // false
-isPromise({}); // false
-```
-
-## `promise/ensure`
-
-If given argument is a promise, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensurePromise = require("type/promise/ensure");
-
-const promise = Promise.resolve();
-ensurePromise(promise); // promise
-eensurePromise({}); // Thrown TypeError: [object Object] is not a promise
-```
diff --git a/system/websocket_test/node_modules/type/docs/prototype.md b/system/websocket_test/node_modules/type/docs/prototype.md
deleted file mode 100644
index 926c256..0000000
--- a/system/websocket_test/node_modules/type/docs/prototype.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Prototype
-
-Some constructor's `prototype` property
-
-## `prototype/is`
-
-Confirms if given object serves as a _prototype_ property
-
-```javascript
-const isPrototype = require("type/prototype/is");
-
-isPrototype({}); // false
-isPrototype(Object.prototype); // true
-isPrototype(Array.prototype); // true
-```
diff --git a/system/websocket_test/node_modules/type/docs/reg-exp.md b/system/websocket_test/node_modules/type/docs/reg-exp.md
deleted file mode 100644
index 00d081c..0000000
--- a/system/websocket_test/node_modules/type/docs/reg-exp.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# RegExp
-
-_RegExp_ instance
-
-## `reg-exp/is`
-
-Confirms if given object is a native regular expression object
-
-```javascript
-const isRegExp = require("type/reg-exp/is");
-
-isRegExp(/foo/);
-isRegExp({}); // false
-isRegExp("foo"); // false
-```
-
-## `reg-exp/ensure`
-
-If given argument is a regular expression object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureRegExp = require("type/reg-exp/ensure");
-
-ensureRegExp(/foo/); // /foo/
-ensureRegExp("foo"); // Thrown TypeError: null is not a regular expression object
-```
diff --git a/system/websocket_test/node_modules/type/docs/safe-integer.md b/system/websocket_test/node_modules/type/docs/safe-integer.md
deleted file mode 100644
index cf4bb1c..0000000
--- a/system/websocket_test/node_modules/type/docs/safe-integer.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Safe Integer Number
-
-Safe integer _number_ primitive
-
-## `safe-integer/coerce`
-
-Follows [`integer/coerce`](integer.md#integercoerce) but returns `null` in place of values which are beyond `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER` range.
-
-```javascript
-const coerceToSafeInteger = require("type/safe-integer/coerce");
-
-coerceToInteger("12.95"); // 12
-coerceToInteger(9007199254740992); // null
-coerceToInteger(null); // null
-```
-
-## `safe-integer/ensure`
-
-If given argument is a safe integer coercible value (via [`safe-integer/coerce`](#safe-integercoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureSafeInteger = require("type/safe-integer/ensure");
-
-ensureSafeInteger(12.93); // "12"
-ensureSafeInteger(9007199254740992); // Thrown TypeError: null is not a safe integer
-```
diff --git a/system/websocket_test/node_modules/type/docs/set.md b/system/websocket_test/node_modules/type/docs/set.md
deleted file mode 100644
index 33f8876..0000000
--- a/system/websocket_test/node_modules/type/docs/set.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Set
-
-_Set_ instance
-
-## `set/is`
-
-Confirms if given object is a native set\_
-
-```javascript
-const isSet = require("type/set/is");
-
-isSet(new Set()); // true
-isSet(new Map()); // false
-isSet({}); // false
-```
-
-## `Set/ensure`
-
-If given argument is a _set_, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureSet = require("type/set/ensure");
-
-const set = new Set();
-ensureSet(set); // set
-eensureSet({}); // Thrown TypeError: [object Object] is not a set
-```
diff --git a/system/websocket_test/node_modules/type/docs/string.md b/system/websocket_test/node_modules/type/docs/string.md
deleted file mode 100644
index 051b4a3..0000000
--- a/system/websocket_test/node_modules/type/docs/string.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# String
-
-_string_ primitive
-
-## `string/coerce`
-
-Restricted string coercion. Returns string presentation for every value that follows below constraints
-
-- is implicitly coercible to string
-- is neither`null` nor `undefined`
-- its `toString` method is not `Object.prototype.toString`
-
-For all other values `null` is returned
-
-```javascript
-const coerceToString = require("type/string/coerce");
-
-coerceToString(12); // "12"
-coerceToString(undefined); // null
-```
-
-## `string/ensure`
-
-If given argument is a string coercible value (via [`string/coerce`](#stringcoerce)) returns result string.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureString = require("type/string/ensure");
-
-ensureString(12); // "12"
-ensureString(null); // Thrown TypeError: null is not a string
-```
diff --git a/system/websocket_test/node_modules/type/docs/thenable.md b/system/websocket_test/node_modules/type/docs/thenable.md
deleted file mode 100644
index 1bdf92d..0000000
--- a/system/websocket_test/node_modules/type/docs/thenable.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Thenable
-
-_Thenable_ object (an object with `then` method)
-
-## `thenable/is`
-
-Confirms if given object is a _thenable_
-
-```javascript
-const isThenable = require("type/thenable/is");
-
-isThenable(Promise.resolve()); // true
-isThenable({ then: () => {} }); // true
-isThenable({}); // false
-```
-
-## `thenable/ensure`
-
-If given argument is a _thenable_ object, it is returned back. Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureThenable = require("type/thenable/ensure");
-
-const promise = Promise.resolve();
-ensureThenable(promise); // promise
-ensureThenable({}); // Thrown TypeError: [object Object] is not a thenable object
-```
diff --git a/system/websocket_test/node_modules/type/docs/time-value.md b/system/websocket_test/node_modules/type/docs/time-value.md
deleted file mode 100644
index 98e9e8e..0000000
--- a/system/websocket_test/node_modules/type/docs/time-value.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Time value
-
-_number_ primitive which is a valid _time value_ (as used internally in _Date_ instances)
-
-## `time-value/coerce`
-
-Follows [`integer/coerce`](integer.md#integercoerce) but returns `null` in place of values which go beyond 100 000 0000 days from unix epoch
-
-```javascript
-const coerceToTimeValue = require("type/time-value/coerce");
-
-coerceToTimeValue(12312312); // true
-coerceToTimeValue(Number.MAX_SAFE_INTEGER); // false
-coerceToTimeValue("foo"); // false
-```
-
-## `time-value/ensure`
-
-If given argument is a _time value_ coercible value (via [`time-value/coerce`](#time-valuecoerce)) returns result number.
-Otherwise `TypeError` is thrown.
-
-```javascript
-const ensureTimeValue = require("type/time-value/ensure");
-
-ensureTimeValue(12.93); // "12"
-ensureTimeValue(Number.MAX_SAFE_INTEGER); // Thrown TypeError: null is not a natural number
-```
diff --git a/system/websocket_test/node_modules/type/docs/value.md b/system/websocket_test/node_modules/type/docs/value.md
deleted file mode 100644
index 1310609..0000000
--- a/system/websocket_test/node_modules/type/docs/value.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Value
-
-_Value_, any value that's neither `null` nor `undefined` .
-
-## `value/is`
-
-Confirms whether passed argument is a _value_
-
-```javascript
-const isValue = require("type/value/is");
-
-isValue({}); // true
-isValue(null); // false
-```
-
-## `value/ensure`
-
-Ensures if given argument is a _value_. If it's a value it is returned back, if not `TypeError` is thrown
-
-```javascript
-const ensureValue = require("type/value/ensure");
-
-const obj = {};
-
-ensureValue(obj); // obj
-ensureValue(null); // Thrown TypeError: Cannot use null
-```
diff --git a/system/websocket_test/node_modules/type/ensure.js b/system/websocket_test/node_modules/type/ensure.js
deleted file mode 100644
index 7fe8220..0000000
--- a/system/websocket_test/node_modules/type/ensure.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-var isArray = require("./array/is")
- , toShortString = require("./lib/to-short-string");
-
-var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-var assign = function (target, source) {
- for (var key in source) {
- if (objPropertyIsEnumerable.call(source, key)) target[key] = source[key];
- }
-};
-
-module.exports = function (validationDatum1/*, ...validationDatumN, options */) {
- var validationData = [validationDatum1];
- var globalOptions;
- if (arguments.length > 1) {
- var hasOptions = !isArray(arguments[arguments.length - 1]);
- if (hasOptions) globalOptions = arguments[arguments.length - 1];
- var lastDatumIndex = hasOptions ? arguments.length - 2 : arguments.length - 1;
- for (var i = 1; i <= lastDatumIndex; ++i) validationData.push(arguments[i]);
- }
- var result = [], errors;
- for (var j = 0; j < validationData.length; ++j) {
- var validationDatum = validationData[j];
- var options = { name: validationDatum[0] };
- if (globalOptions) assign(options, globalOptions);
- if (validationDatum[3]) assign(options, validationDatum[3]);
- var resultItem;
- if (typeof validationDatum[2] !== "function") {
- throw new TypeError(toShortString(validationDatum[2]) + " is not a function");
- }
- try {
- resultItem = validationDatum[2](validationDatum[1], options);
- } catch (error) {
- if (!errors) errors = [];
- errors.push(error);
- }
- if (errors) continue;
- result.push(resultItem);
- }
- if (!errors) return result;
-
- if (errors.length === 1) throw errors[0];
- var ErrorConstructor = (globalOptions && globalOptions.Error) || TypeError;
- var errorMessage = "Approached following errors:";
- for (var k = 0; k < errors.length; ++k) {
- errorMessage += "\n - " + errors[k].message.split("\n").join("\n ");
- }
- throw new ErrorConstructor(errorMessage);
-};
diff --git a/system/websocket_test/node_modules/type/error/ensure.js b/system/websocket_test/node_modules/type/error/ensure.js
deleted file mode 100644
index 8b28d85..0000000
--- a/system/websocket_test/node_modules/type/error/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected an error for %n, received %v" : "%v is not an error";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/error/is.js b/system/websocket_test/node_modules/type/error/is.js
deleted file mode 100644
index bf04c80..0000000
--- a/system/websocket_test/node_modules/type/error/is.js
+++ /dev/null
@@ -1,45 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is")
- , isPlainObject = require("../plain-object/is");
-
-var objectToString = Object.prototype.toString;
-
-// Recognize host specific errors (e.g. DOMException)
-var errorTaggedStringRe = /^\[object .*(?:Error|Exception)\]$/
- , errorNameRe = /^[^\s]*(?:Error|Exception)$/;
-
-module.exports = function (value) {
- if (!value) return false;
-
- var name;
- // Sanity check (reject objects which do not expose common Error interface)
- try {
- name = value.name;
- if (typeof name !== "string") return false;
- if (typeof value.message !== "string") return false;
- } catch (error) {
- return false;
- }
-
- // Ensure its a native-like Error object
- // (has [[ErrorData]] slot, or was created to resemble one)
- // Note: It's not a 100% bulletproof check of confirming that as:
- // - In ES2015+ string tag can be overriden via Symbol.toStringTag property
- // - Host errors do not share native error tag. Still we rely on assumption that
- // tag for each error will end either with `Error` or `Exception` string
- // - In pre ES2015 era, no custom errors will share the error tag.
- if (!errorTaggedStringRe.test(objectToString.call(value))) {
- // Definitely not an ES2015 error instance, but could still be an error
- // (created via e.g. CustomError.prototype = Object.create(Error.prototype))
- try {
- if (name !== value.constructor.name) return false;
- } catch (error) {
- return false;
- }
- if (!errorNameRe.test(name)) return false;
- if (isPlainObject(value)) return false;
- }
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/finite/coerce.js b/system/websocket_test/node_modules/type/finite/coerce.js
deleted file mode 100644
index a3783be..0000000
--- a/system/websocket_test/node_modules/type/finite/coerce.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-var coerceToNumber = require("../number/coerce");
-
-module.exports = function (value) {
- value = coerceToNumber(value);
- return isFinite(value) ? value : null;
-};
diff --git a/system/websocket_test/node_modules/type/finite/ensure.js b/system/websocket_test/node_modules/type/finite/ensure.js
deleted file mode 100644
index aac96be..0000000
--- a/system/websocket_test/node_modules/type/finite/ensure.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a finite number for %n, received %v"
- : "%v is not a finite number";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/function/ensure.js b/system/websocket_test/node_modules/type/function/ensure.js
deleted file mode 100644
index d133701..0000000
--- a/system/websocket_test/node_modules/type/function/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a function for %n, received %v"
- : "%v is not a function";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/function/is.js b/system/websocket_test/node_modules/type/function/is.js
deleted file mode 100644
index 981990a..0000000
--- a/system/websocket_test/node_modules/type/function/is.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-module.exports = function (value) {
- if (typeof value !== "function") return false;
-
- if (!hasOwnProperty.call(value, "length")) return false;
-
- try {
- if (typeof value.length !== "number") return false;
- if (typeof value.call !== "function") return false;
- if (typeof value.apply !== "function") return false;
- } catch (error) {
- return false;
- }
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/integer/coerce.js b/system/websocket_test/node_modules/type/integer/coerce.js
deleted file mode 100644
index cba5e17..0000000
--- a/system/websocket_test/node_modules/type/integer/coerce.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-
-var coerceToFinite = require("../finite/coerce");
-
-var abs = Math.abs, floor = Math.floor;
-
-module.exports = function (value) {
- value = coerceToFinite(value);
- if (!value) return value;
- return (value > 0 ? 1 : -1) * floor(abs(value));
-};
diff --git a/system/websocket_test/node_modules/type/integer/ensure.js b/system/websocket_test/node_modules/type/integer/ensure.js
deleted file mode 100644
index df1a975..0000000
--- a/system/websocket_test/node_modules/type/integer/ensure.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected an integer for %n, received %v"
- : "%v is not an integer";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/iterable/ensure.js b/system/websocket_test/node_modules/type/iterable/ensure.js
deleted file mode 100644
index b1a2489..0000000
--- a/system/websocket_test/node_modules/type/iterable/ensure.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , resolveErrorMessage = require("../lib/resolve-error-message")
- , toShortString = require("../lib/to-short-string")
- , ensurePlainFunction = require("../plain-function/ensure")
- , is = require("./is");
-
-var invalidItemsLimit = 3;
-
-module.exports = function (value/*, options*/) {
- var options = arguments[1];
- var mainErrorMessage =
- options && options.name
- ? "Expected an iterable for %n, received %v"
- : "%v is not expected iterable";
- if (!is(value, options)) return resolveException(value, mainErrorMessage, options);
- if (!options) return value;
-
- var ensureItem = ensurePlainFunction(options.ensureItem, { isOptional: true });
- if (ensureItem) {
- var coercedValue = [];
- var iterator = value[Symbol.iterator]();
- var item, invalidItems;
- while (!(item = iterator.next()).done) {
- var newItemValue;
- try {
- newItemValue = ensureItem(item.value);
- } catch (error) {
- if (!invalidItems) invalidItems = [];
- if (invalidItems.push(item.value) === invalidItemsLimit) break;
- }
- if (invalidItems) continue;
- coercedValue.push(newItemValue);
- }
- if (invalidItems) {
- var errorMessage =
- resolveErrorMessage(mainErrorMessage, value, options) +
- ".\n Following items are invalid:";
- for (var i = 0; i < invalidItems.length; ++i) {
- errorMessage += "\n - " + toShortString(invalidItems[i]);
- }
- throw new TypeError(errorMessage);
- }
- return coercedValue;
- }
-
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/iterable/is.js b/system/websocket_test/node_modules/type/iterable/is.js
deleted file mode 100644
index d35408c..0000000
--- a/system/websocket_test/node_modules/type/iterable/is.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Polyfills friendly, therefore ES5 syntax
-
-"use strict";
-
-var isObject = require("../object/is");
-
-var iteratorSymbol = Symbol.iterator;
-
-if (!iteratorSymbol) {
- throw new Error("Cannot initialize iterator/is due to Symbol.iterator not being implemented");
-}
-
-module.exports = function (value/*, options*/) {
- var options = arguments[1];
- if (!isObject(value)) {
- if (!isObject(options) || !options.allowString || typeof value !== "string") return false;
- }
- try {
- if (typeof value[iteratorSymbol] !== "function") return false;
- } catch (error) {
- return false;
- }
- if (!options) return true;
- if (options.denyEmpty) {
- try {
- if (value[iteratorSymbol]().next().done) return false;
- } catch (error) {
- return false;
- }
- }
- return true;
-};
diff --git a/system/websocket_test/node_modules/type/lib/ensure/min.js b/system/websocket_test/node_modules/type/lib/ensure/min.js
deleted file mode 100644
index df878bd..0000000
--- a/system/websocket_test/node_modules/type/lib/ensure/min.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../resolve-exception");
-
-module.exports = function (value, coerced, options) {
- if (coerced >= options.min) return coerced;
- var errorMessage =
- options && options.name
- ? "Expected %n to be greater or equal " + options.min + ", received %v"
- : "%v is not greater or equal " + options.min;
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/lib/is-to-string-tag-supported.js b/system/websocket_test/node_modules/type/lib/is-to-string-tag-supported.js
deleted file mode 100644
index 254d8b3..0000000
--- a/system/websocket_test/node_modules/type/lib/is-to-string-tag-supported.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-module.exports = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
diff --git a/system/websocket_test/node_modules/type/lib/resolve-error-message.js b/system/websocket_test/node_modules/type/lib/resolve-error-message.js
deleted file mode 100644
index 3cb000b..0000000
--- a/system/websocket_test/node_modules/type/lib/resolve-error-message.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-
-var stringCoerce = require("../string/coerce")
- , toShortString = require("./to-short-string");
-
-module.exports = function (errorMessage, value, inputOptions) {
- if (inputOptions && inputOptions.errorMessage) {
- errorMessage = stringCoerce(inputOptions.errorMessage);
- }
-
- var valueInsertIndex = errorMessage.indexOf("%v");
- var valueToken = valueInsertIndex > -1 ? toShortString(value) : null;
- if (inputOptions && inputOptions.name) {
- var nameInsertIndex = errorMessage.indexOf("%n");
- if (nameInsertIndex > -1) {
- if (valueInsertIndex > -1) {
- var firstToken, secondToken, firstInsertIndex, secondInsertIndex;
- if (nameInsertIndex > valueInsertIndex) {
- firstToken = valueToken;
- firstInsertIndex = valueInsertIndex;
- secondToken = inputOptions.name;
- secondInsertIndex = nameInsertIndex;
- } else {
- firstToken = inputOptions.name;
- firstInsertIndex = nameInsertIndex;
- secondToken = valueToken;
- secondInsertIndex = valueInsertIndex;
- }
- return (
- errorMessage.slice(0, firstInsertIndex) +
- firstToken +
- errorMessage.slice(firstInsertIndex + 2, secondInsertIndex) +
- secondToken +
- errorMessage.slice(secondInsertIndex + 2)
- );
- }
- return (
- errorMessage.slice(0, nameInsertIndex) +
- inputOptions.name +
- errorMessage.slice(nameInsertIndex + 2)
- );
- }
- }
- if (valueInsertIndex > -1) {
- return (
- errorMessage.slice(0, valueInsertIndex) +
- valueToken +
- errorMessage.slice(valueInsertIndex + 2)
- );
- }
- return errorMessage;
-};
diff --git a/system/websocket_test/node_modules/type/lib/resolve-exception.js b/system/websocket_test/node_modules/type/lib/resolve-exception.js
deleted file mode 100644
index 6c99286..0000000
--- a/system/websocket_test/node_modules/type/lib/resolve-exception.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var isValue = require("../value/is")
- , resolveErrorMessage = require("./resolve-error-message");
-
-module.exports = function (value, defaultMessage, inputOptions) {
- if (inputOptions && !isValue(value)) {
- if ("default" in inputOptions) return inputOptions["default"];
- if (inputOptions.isOptional) return null;
- }
- var ErrorConstructor = (inputOptions && inputOptions.Error) || TypeError;
- var error = new ErrorConstructor(resolveErrorMessage(defaultMessage, value, inputOptions));
- if (inputOptions && inputOptions.errorCode) error.code = inputOptions.errorCode;
- throw error;
-};
diff --git a/system/websocket_test/node_modules/type/lib/safe-to-string.js b/system/websocket_test/node_modules/type/lib/safe-to-string.js
deleted file mode 100644
index a756dd3..0000000
--- a/system/websocket_test/node_modules/type/lib/safe-to-string.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-module.exports = function (value) {
- try {
- return value.toString();
- } catch (error) {
- try { return String(value); }
- catch (error2) { return null; }
- }
-};
diff --git a/system/websocket_test/node_modules/type/lib/to-short-string.js b/system/websocket_test/node_modules/type/lib/to-short-string.js
deleted file mode 100644
index c8d7ed8..0000000
--- a/system/websocket_test/node_modules/type/lib/to-short-string.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-var safeToString = require("./safe-to-string");
-
-var reNewLine = /[\n\r\u2028\u2029]/g;
-
-module.exports = function (value) {
- var string = safeToString(value);
- if (string === null) return "";
- // Trim if too long
- if (string.length > 100) string = string.slice(0, 99) + "…";
- // Replace eventual new lines
- string = string.replace(reNewLine, function (char) {
- switch (char) {
- case "\n":
- return "\\n";
- case "\r":
- return "\\r";
- case "\u2028":
- return "\\u2028";
- case "\u2029":
- return "\\u2029";
- /* istanbul ignore next */
- default:
- throw new Error("Unexpected character");
- }
- });
- return string;
-};
diff --git a/system/websocket_test/node_modules/type/map/ensure.js b/system/websocket_test/node_modules/type/map/ensure.js
deleted file mode 100644
index 3e3325a..0000000
--- a/system/websocket_test/node_modules/type/map/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value /*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a map for %n, received %v" : "%v is not a map";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/map/is.js b/system/websocket_test/node_modules/type/map/is.js
deleted file mode 100644
index 4ed7bae..0000000
--- a/system/websocket_test/node_modules/type/map/is.js
+++ /dev/null
@@ -1,28 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-// In theory we could rely on Symbol.toStringTag directly,
-// still early native implementation (e.g. in FF) predated symbols
-var objectToString = Object.prototype.toString, objectTaggedString = objectToString.call(new Map());
-
-module.exports = function (value) {
- if (!value) return false;
-
- // Sanity check (reject objects which do not expose common Promise interface)
- try {
- if (typeof value.set !== "function") return false;
- if (typeof value.get !== "function") return false;
- if (typeof value.has !== "function") return false;
- if (typeof value.clear !== "function") return false;
- } catch (error) {
- return false;
- }
-
- // Ensure its native Promise object (has [[MapData]] slot)
- // Note: it's not 100% precise as string tag may be overriden
- // and other objects could be hacked to expose it
- if (objectToString.call(value) !== objectTaggedString) return false;
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/natural-number/coerce.js b/system/websocket_test/node_modules/type/natural-number/coerce.js
deleted file mode 100644
index 4b7931c..0000000
--- a/system/websocket_test/node_modules/type/natural-number/coerce.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-var coerceToInteger = require("../integer/coerce");
-
-module.exports = function (value) {
- value = coerceToInteger(value);
- if (!value) return value;
- if (value < 0) return null;
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/natural-number/ensure.js b/system/websocket_test/node_modules/type/natural-number/ensure.js
deleted file mode 100644
index 1f09174..0000000
--- a/system/websocket_test/node_modules/type/natural-number/ensure.js
+++ /dev/null
@@ -1,21 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , ensureMin = require("../lib/ensure/min")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value), options = arguments[1];
- if (coerced !== null) {
- if (options) {
- if (options.min) ensureMin(value, coerced, options);
- }
- return coerced;
- }
-
- var errorMessage =
- options && options.name
- ? "Expected a natural number for %n, received %v"
- : "%v is not a natural number";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/number/coerce.js b/system/websocket_test/node_modules/type/number/coerce.js
deleted file mode 100644
index 1bb1512..0000000
--- a/system/websocket_test/node_modules/type/number/coerce.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var isValue = require("../value/is");
-
-module.exports = function (value) {
- if (!isValue(value)) return null;
- try {
- value = +value; // Ensure implicit coercion
- } catch (error) {
- return null;
- }
- if (isNaN(value)) return null;
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/number/ensure.js b/system/websocket_test/node_modules/type/number/ensure.js
deleted file mode 100644
index 9ae705d..0000000
--- a/system/websocket_test/node_modules/type/number/ensure.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a number for %n, received %v" : "%v is not a number";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/object/ensure.js b/system/websocket_test/node_modules/type/object/ensure.js
deleted file mode 100644
index 341f55c..0000000
--- a/system/websocket_test/node_modules/type/object/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected an object for %n, received %v" : "%v is not an object";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/object/is.js b/system/websocket_test/node_modules/type/object/is.js
deleted file mode 100644
index a254dcb..0000000
--- a/system/websocket_test/node_modules/type/object/is.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-
-var isValue = require("../value/is");
-
-// prettier-ignore
-var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ };
-
-module.exports = function (value) {
- if (!isValue(value)) return false;
- return hasOwnProperty.call(possibleTypes, typeof value);
-};
diff --git a/system/websocket_test/node_modules/type/package.json b/system/websocket_test/node_modules/type/package.json
deleted file mode 100644
index a863fbf..0000000
--- a/system/websocket_test/node_modules/type/package.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
- "name": "type",
- "version": "2.7.2",
- "description": "Runtime validation and processing of JavaScript types",
- "author": "Mariusz Nowak (https://www.medikoo.com/)",
- "keywords": [
- "type",
- "coercion"
- ],
- "repository": "medikoo/type",
- "devDependencies": {
- "chai": "^4.3.6",
- "eslint": "^8.21.0",
- "eslint-config-medikoo": "^4.1.2",
- "git-list-updated": "^1.2.1",
- "github-release-from-cc-changelog": "^2.3.0",
- "husky": "^4.3.8",
- "lint-staged": "^13.0.3",
- "mocha": "^6.2.3",
- "nyc": "^15.1.0",
- "prettier-elastic": "^2.2.1"
- },
- "typesVersions": {
- ">=4": {
- "*": [
- "ts-types/*"
- ]
- }
- },
- "husky": {
- "hooks": {
- "pre-commit": "lint-staged"
- }
- },
- "lint-staged": {
- "*.js": [
- "eslint"
- ],
- "*.{css,html,js,json,md,yaml,yml}": [
- "prettier -c"
- ]
- },
- "eslintConfig": {
- "extends": "medikoo/es3",
- "root": true,
- "globals": {
- "BigInt": true,
- "Map": true,
- "Promise": true,
- "Set": true,
- "Symbol": true
- },
- "overrides": [
- {
- "files": "test/**/*.js",
- "env": {
- "mocha": true
- },
- "rules": {
- "no-eval": "off",
- "no-new-wrappers": "off"
- }
- },
- {
- "files": [
- "string/coerce.js",
- "number/coerce.js"
- ],
- "rules": {
- "no-implicit-coercion": "off"
- }
- },
- {
- "files": "plain-object/is.js",
- "rules": {
- "no-proto": "off"
- }
- }
- ]
- },
- "prettier": {
- "printWidth": 100,
- "tabWidth": 4,
- "overrides": [
- {
- "files": [
- "*.md",
- "*.yml"
- ],
- "options": {
- "tabWidth": 2
- }
- }
- ]
- },
- "nyc": {
- "all": true,
- "exclude": [
- ".github",
- "coverage/**",
- "test/**",
- "*.config.js"
- ],
- "reporter": [
- "lcov",
- "html",
- "text-summary"
- ]
- },
- "scripts": {
- "coverage": "nyc npm test",
- "lint:updated": "pipe-git-updated --base=main --ext=js -- eslint --ignore-pattern '!*'",
- "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettier-check:updated": "pipe-git-updated --base=main --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
- "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
- "prettify:updated": "pipe-git-updated ---base=main -ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
- "test": "mocha --recursive"
- },
- "license": "ISC"
-}
diff --git a/system/websocket_test/node_modules/type/plain-function/ensure.js b/system/websocket_test/node_modules/type/plain-function/ensure.js
deleted file mode 100644
index d3a20e6..0000000
--- a/system/websocket_test/node_modules/type/plain-function/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a plain function for %n, received %v"
- : "%v is not a plain function";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/plain-function/is.js b/system/websocket_test/node_modules/type/plain-function/is.js
deleted file mode 100644
index b55d4ff..0000000
--- a/system/websocket_test/node_modules/type/plain-function/is.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-
-var isFunction = require("../function/is");
-
-var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString;
-
-module.exports = function (value) {
- if (!isFunction(value)) return false;
- if (classRe.test(functionToString.call(value))) return false;
- return true;
-};
diff --git a/system/websocket_test/node_modules/type/plain-object/ensure.js b/system/websocket_test/node_modules/type/plain-object/ensure.js
deleted file mode 100644
index 519261e..0000000
--- a/system/websocket_test/node_modules/type/plain-object/ensure.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , resolveErrorMessage = require("../lib/resolve-error-message")
- , ensurePlainFunction = require("../plain-function/ensure")
- , ensureArray = require("../array/ensure")
- , is = require("./is");
-
-var objHasOwnProperty = Object.prototype.hasOwnProperty, invalidItemsLimit = 3;
-
-module.exports = function (value/*, options*/) {
- var options = arguments[1];
- var mainErrorMessage =
- options && options.name
- ? "Expected a plain object for %n, received %v"
- : "%v is not a plain object";
- if (!is(value)) return resolveException(value, mainErrorMessage, options);
- if (!options) return value;
-
- var invalidKeys, key, errorMessage;
- var allowedKeys = ensureArray(options.allowedKeys, { isOptional: true });
- if (allowedKeys) {
- for (key in value) {
- if (!objHasOwnProperty.call(value, key)) continue;
- if (allowedKeys.indexOf(key) > -1) continue;
- if (!invalidKeys) invalidKeys = [];
- if (invalidKeys.push(key) === invalidItemsLimit) break;
- }
- if (invalidKeys) {
- errorMessage =
- resolveErrorMessage(mainErrorMessage, value, options) +
- ".\n Following keys are unexpected: " +
- invalidKeys.join(", ");
- throw new TypeError(errorMessage);
- }
- }
-
- var ensurePropertyValue = ensurePlainFunction(options.ensurePropertyValue, {
- isOptional: true
- });
- if (ensurePropertyValue) {
- var coercedValue = {};
- for (key in value) {
- if (!objHasOwnProperty.call(value, key)) continue;
- var coercedPropertyValue;
- try {
- coercedPropertyValue = ensurePropertyValue(value[key]);
- } catch (error) {
- if (!invalidKeys) invalidKeys = [];
- if (invalidKeys.push(key) === invalidItemsLimit) break;
- }
- if (invalidKeys) continue;
- coercedValue[key] = coercedPropertyValue;
- }
- if (invalidKeys) {
- errorMessage =
- resolveErrorMessage(mainErrorMessage, value, options) +
- ".\n Values for following keys are invalid: " +
- invalidKeys.join(", ");
- throw new TypeError(errorMessage);
- }
-
- return coercedValue;
- }
-
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/plain-object/is.js b/system/websocket_test/node_modules/type/plain-object/is.js
deleted file mode 100644
index 50d6713..0000000
--- a/system/websocket_test/node_modules/type/plain-object/is.js
+++ /dev/null
@@ -1,28 +0,0 @@
-"use strict";
-
-var isObject = require("../object/is")
- , isPrototype = require("../prototype/is");
-
-var getPrototypeOf;
-if (typeof Object.getPrototypeOf === "function") {
- getPrototypeOf = Object.getPrototypeOf;
-} else if ({}.__proto__ === Object.prototype) {
- getPrototypeOf = function (object) { return object.__proto__; };
-}
-
-module.exports = function (value) {
- if (!isObject(value)) return false;
- var prototype;
- if (getPrototypeOf) {
- prototype = getPrototypeOf(value);
- } else {
- try {
- var valueConstructor = value.constructor;
- if (valueConstructor) prototype = valueConstructor.prototype;
- } catch (error) {
- return false;
- }
- }
- if (prototype && !hasOwnProperty.call(prototype, "propertyIsEnumerable")) return false;
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/promise/ensure.js b/system/websocket_test/node_modules/type/promise/ensure.js
deleted file mode 100644
index 7fbebb3..0000000
--- a/system/websocket_test/node_modules/type/promise/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a promise for %n, received %v" : "%v is not a promise";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/promise/is.js b/system/websocket_test/node_modules/type/promise/is.js
deleted file mode 100644
index 5353362..0000000
--- a/system/websocket_test/node_modules/type/promise/is.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-// In theory we could rely on Symbol.toStringTag directly,
-// still early native implementation (e.g. in FF) predated symbols
-var objectToString = Object.prototype.toString
- , objectTaggedString = objectToString.call(Promise.resolve());
-
-module.exports = function (value) {
- if (!value) return false;
-
- // Sanity check (reject objects which do not expose common Promise interface)
- try {
- if (typeof value.then !== "function") return false;
- if (typeof value["catch"] !== "function") return false;
- } catch (error) {
- return false;
- }
-
- // Ensure its native Promise object (has [[PromiseState]] slot)
- // Note: it's not 100% precise as string tag may be overriden
- // and other objects could be hacked to expose it
- if (objectToString.call(value) !== objectTaggedString) return false;
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/prototype/is.js b/system/websocket_test/node_modules/type/prototype/is.js
deleted file mode 100644
index aaddb2a..0000000
--- a/system/websocket_test/node_modules/type/prototype/is.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var isObject = require("../object/is");
-
-module.exports = function (value) {
- if (!isObject(value)) return false;
- try {
- if (!value.constructor) return false;
- return value.constructor.prototype === value;
- } catch (error) {
- return false;
- }
-};
diff --git a/system/websocket_test/node_modules/type/reg-exp/ensure.js b/system/websocket_test/node_modules/type/reg-exp/ensure.js
deleted file mode 100644
index 50669f3..0000000
--- a/system/websocket_test/node_modules/type/reg-exp/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a regular expression for %n, received %v"
- : "%v is not a regular expression";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/reg-exp/is.js b/system/websocket_test/node_modules/type/reg-exp/is.js
deleted file mode 100644
index f0c69d5..0000000
--- a/system/websocket_test/node_modules/type/reg-exp/is.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-
-var isToStringTagSupported = require("../lib/is-to-string-tag-supported")
- , isPrototype = require("../prototype/is");
-
-var regExpTest = RegExp.prototype.test
- , objectToString = Object.prototype.toString
- , objectTaggedString = objectToString.call(/a/);
-
-module.exports = function (value) {
- if (!value) return false;
-
- // Sanity check (reject objects which do not expose common RegExp interface)
- if (!hasOwnProperty.call(value, "lastIndex")) return false;
- try {
- if (typeof value.lastIndex !== "number") return false;
- if (typeof value.test !== "function") return false;
- if (typeof value.exec !== "function") return false;
- } catch (error) {
- return false;
- }
-
- // Ensure its native RegExp object (has [[RegExpMatcher]] slot)
- if (isToStringTagSupported && typeof value[Symbol.toStringTag] === "string") {
- // Edge case (possibly a regExp with custom Symbol.toStringTag)
- try {
- var lastIndex = value.lastIndex;
- regExpTest.call(value, "");
- if (value.lastIndex !== lastIndex) value.lastIndex = lastIndex;
- return true;
- } catch (error) {
- return false;
- }
- }
- if (objectToString.call(value) !== objectTaggedString) return false;
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/safe-integer/coerce.js b/system/websocket_test/node_modules/type/safe-integer/coerce.js
deleted file mode 100644
index b97e4aa..0000000
--- a/system/websocket_test/node_modules/type/safe-integer/coerce.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var coerceToInteger = require("../integer/coerce");
-
-var MAX_SAFE_INTEGER = 9007199254740991, MIN_SAFE_INTEGER = -9007199254740991;
-
-module.exports = function (value) {
- value = coerceToInteger(value);
- if (!value) return value;
- if (value > MAX_SAFE_INTEGER) return null;
- if (value < MIN_SAFE_INTEGER) return null;
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/safe-integer/ensure.js b/system/websocket_test/node_modules/type/safe-integer/ensure.js
deleted file mode 100644
index dbdc46d..0000000
--- a/system/websocket_test/node_modules/type/safe-integer/ensure.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a safe integer for %n, received %v"
- : "%v is not a safe integer";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/set/ensure.js b/system/websocket_test/node_modules/type/set/ensure.js
deleted file mode 100644
index c5b6a41..0000000
--- a/system/websocket_test/node_modules/type/set/ensure.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value /*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a set for %n, received %v" : "%v is not a set";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/set/is.js b/system/websocket_test/node_modules/type/set/is.js
deleted file mode 100644
index d0b137b..0000000
--- a/system/websocket_test/node_modules/type/set/is.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-
-var isPrototype = require("../prototype/is");
-
-// In theory we could rely on Symbol.toStringTag directly,
-// still early native implementation (e.g. in FF) predated symbols
-var objectToString = Object.prototype.toString, objectTaggedString = objectToString.call(new Set());
-
-module.exports = function (value) {
- if (!value) return false;
-
- // Sanity check (reject objects which do not expose common Set interface)
- try {
- if (typeof value.add !== "function") return false;
- if (typeof value.has !== "function") return false;
- if (typeof value.clear !== "function") return false;
- } catch (error) {
- return false;
- }
-
- // Ensure its native Set object (has [[SetData]] slot)
- // Note: it's not 100% precise as string tag may be overriden
- // and other objects could be hacked to expose it
- if (objectToString.call(value) !== objectTaggedString) return false;
-
- return !isPrototype(value);
-};
diff --git a/system/websocket_test/node_modules/type/string/coerce.js b/system/websocket_test/node_modules/type/string/coerce.js
deleted file mode 100644
index 43cd931..0000000
--- a/system/websocket_test/node_modules/type/string/coerce.js
+++ /dev/null
@@ -1,23 +0,0 @@
-"use strict";
-
-var isValue = require("../value/is")
- , isObject = require("../object/is");
-
-var objectToString = Object.prototype.toString;
-
-module.exports = function (value) {
- if (!isValue(value)) return null;
- if (isObject(value)) {
- // Reject Object.prototype.toString coercion
- var valueToString = value.toString;
- if (typeof valueToString !== "function") return null;
- if (valueToString === objectToString) return null;
- // Note: It can be object coming from other realm, still as there's no ES3 and CSP compliant
- // way to resolve its realm's Object.prototype.toString it's left as not addressed edge case
- }
- try {
- return "" + value; // Ensure implicit coercion
- } catch (error) {
- return null;
- }
-};
diff --git a/system/websocket_test/node_modules/type/string/ensure.js b/system/websocket_test/node_modules/type/string/ensure.js
deleted file mode 100644
index e26b5f0..0000000
--- a/system/websocket_test/node_modules/type/string/ensure.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name ? "Expected a string for %n, received %v" : "%v is not a string";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/thenable/ensure.js b/system/websocket_test/node_modules/type/thenable/ensure.js
deleted file mode 100644
index 8397c7c..0000000
--- a/system/websocket_test/node_modules/type/thenable/ensure.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , is = require("./is");
-
-module.exports = function (value/*, options*/) {
- if (is(value)) return value;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a thenable for %n, received %v"
- : "%v is not a thenable";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/thenable/is.js b/system/websocket_test/node_modules/type/thenable/is.js
deleted file mode 100644
index 1f3d399..0000000
--- a/system/websocket_test/node_modules/type/thenable/is.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-var isObject = require("../object/is");
-
-module.exports = function (value) {
- if (!isObject(value)) return false;
- try { return typeof value.then === "function"; }
- catch (error) { return false; }
-};
diff --git a/system/websocket_test/node_modules/type/time-value/coerce.js b/system/websocket_test/node_modules/type/time-value/coerce.js
deleted file mode 100644
index 7124864..0000000
--- a/system/websocket_test/node_modules/type/time-value/coerce.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var coerceToInteger = require("../integer/coerce");
-
-var abs = Math.abs;
-
-module.exports = function (value) {
- value = coerceToInteger(value);
- if (!value) return value;
- if (abs(value) > 8.64e15) return null;
- return value;
-};
diff --git a/system/websocket_test/node_modules/type/time-value/ensure.js b/system/websocket_test/node_modules/type/time-value/ensure.js
deleted file mode 100644
index ddf4f61..0000000
--- a/system/websocket_test/node_modules/type/time-value/ensure.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-var resolveException = require("../lib/resolve-exception")
- , coerce = require("./coerce");
-
-module.exports = function (value/*, options*/) {
- var coerced = coerce(value);
- if (coerced !== null) return coerced;
- var options = arguments[1];
- var errorMessage =
- options && options.name
- ? "Expected a time value for %n, received %v"
- : "%v is not a time value";
- return resolveException(value, errorMessage, options);
-};
diff --git a/system/websocket_test/node_modules/type/ts-types/array-length/coerce.d.ts b/system/websocket_test/node_modules/type/ts-types/array-length/coerce.d.ts
deleted file mode 100644
index e949e11..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array-length/coerce.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function coerceToArrayLength(value: any): number | null;
-export default coerceToArrayLength;
diff --git a/system/websocket_test/node_modules/type/ts-types/array-length/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/array-length/ensure.d.ts
deleted file mode 100644
index 25c9370..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array-length/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureArrayLength(value: any, options?: EnsureBaseOptions): number;
-declare function ensureArrayLength(value: any, options?: EnsureBaseOptions & EnsureIsOptional): number | null;
-declare function ensureArrayLength(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): number;
-
-export default ensureArrayLength;
diff --git a/system/websocket_test/node_modules/type/ts-types/array-like/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/array-like/ensure.d.ts
deleted file mode 100644
index 549febe..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array-like/ensure.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-type LengthwiseObject = { length: number } & object;
-type ArrayLikeEnsureOptions = { allowString?: boolean };
-
-
-declare function ensureArrayLike(value: any, options?: ArrayLikeEnsureOptions & EnsureBaseOptions): T[] | string | LengthwiseObject;
-declare function ensureArrayLike(value: any, options?: ArrayLikeEnsureOptions & EnsureBaseOptions & EnsureIsOptional): T[] | string | LengthwiseObject | null;
-declare function ensureArrayLike(value: any, options?: ArrayLikeEnsureOptions & EnsureBaseOptions & EnsureIsOptional & EnsureDefault): T[] | string | LengthwiseObject;
-
-export default ensureArrayLike;
diff --git a/system/websocket_test/node_modules/type/ts-types/array-like/is.d.ts b/system/websocket_test/node_modules/type/ts-types/array-like/is.d.ts
deleted file mode 100644
index acdd657..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array-like/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isArrayLike(value: any, options?: {allowString?: boolean}): boolean;
-export default isArrayLike;
diff --git a/system/websocket_test/node_modules/type/ts-types/array/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/array/ensure.d.ts
deleted file mode 100644
index 6c249b7..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array/ensure.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { EnsureFunction, EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-type EnsureArrayOptions = { ensureItem?: EnsureFunction };
-
-
-declare function ensureArray(value: any, options?: EnsureArrayOptions & EnsureBaseOptions): T[];
-declare function ensureArray(value: any, options?: EnsureArrayOptions & EnsureBaseOptions & EnsureIsOptional): T[] | null;
-declare function ensureArray(value: any, options?: EnsureArrayOptions & EnsureBaseOptions & EnsureIsOptional & EnsureDefault): T[];
-
-export default ensureArray;
diff --git a/system/websocket_test/node_modules/type/ts-types/array/is.d.ts b/system/websocket_test/node_modules/type/ts-types/array/is.d.ts
deleted file mode 100644
index 71af03e..0000000
--- a/system/websocket_test/node_modules/type/ts-types/array/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isArray(value: any): boolean;
-export default isArray;
diff --git a/system/websocket_test/node_modules/type/ts-types/big-int/coerce.d.ts b/system/websocket_test/node_modules/type/ts-types/big-int/coerce.d.ts
deleted file mode 100644
index 8c73fc6..0000000
--- a/system/websocket_test/node_modules/type/ts-types/big-int/coerce.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function coerceToBigInt(value: any): bigint | null;
-export default coerceToBigInt;
diff --git a/system/websocket_test/node_modules/type/ts-types/big-int/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/big-int/ensure.d.ts
deleted file mode 100644
index 93073cb..0000000
--- a/system/websocket_test/node_modules/type/ts-types/big-int/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureBigInt(value: any, options?: EnsureBaseOptions): bigint;
-declare function ensureBigInt(value: any, options?: EnsureBaseOptions & EnsureIsOptional): bigint | null;
-declare function ensureBigInt(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): bigint;
-
-export default ensureBigInt;
diff --git a/system/websocket_test/node_modules/type/ts-types/constructor/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/constructor/ensure.d.ts
deleted file mode 100644
index 79dd28c..0000000
--- a/system/websocket_test/node_modules/type/ts-types/constructor/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureFunction, EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureConstructor(value: any, options?: EnsureBaseOptions): EnsureFunction | object;
-declare function ensureConstructor(value: any, options?: EnsureBaseOptions & EnsureIsOptional): EnsureFunction | object | null;
-declare function ensureConstructor(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): EnsureFunction | object;
-
-export default ensureConstructor;
diff --git a/system/websocket_test/node_modules/type/ts-types/constructor/is.d.ts b/system/websocket_test/node_modules/type/ts-types/constructor/is.d.ts
deleted file mode 100644
index 768a635..0000000
--- a/system/websocket_test/node_modules/type/ts-types/constructor/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isConstructor(value: any): boolean;
-export default isConstructor;
diff --git a/system/websocket_test/node_modules/type/ts-types/date/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/date/ensure.d.ts
deleted file mode 100644
index d96ad31..0000000
--- a/system/websocket_test/node_modules/type/ts-types/date/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureDate(value: any, options?: EnsureBaseOptions): Date;
-declare function ensureDate(value: any, options?: EnsureBaseOptions & EnsureIsOptional): Date | null;
-declare function ensureDate(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): Date;
-
-export default ensureDate;
diff --git a/system/websocket_test/node_modules/type/ts-types/date/is.d.ts b/system/websocket_test/node_modules/type/ts-types/date/is.d.ts
deleted file mode 100644
index 7907a8f..0000000
--- a/system/websocket_test/node_modules/type/ts-types/date/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isDate(value: any): boolean;
-export default isDate;
diff --git a/system/websocket_test/node_modules/type/ts-types/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/ensure.d.ts
deleted file mode 100644
index 62ba597..0000000
--- a/system/websocket_test/node_modules/type/ts-types/ensure.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export type EnsureFunction = (...args: any[]) => any;
-export interface EnsureBaseOptions {
- name?: string;
- errorMessage?: string;
- errorCode?: number;
- Error?: ErrorConstructor;
-}
-
-export interface EnsureIsOptional {
- isOptional: boolean;
-}
-
-export interface EnsureDefault {
- default: T;
-}
-
-type EnsureOptions = EnsureBaseOptions & { isOptional?: boolean } & { default?: any };
-
-type ValidationDatum = [argumentName: string, inputValue: any, ensureFunction: EnsureFunction, options?: object];
-type ValidationDatumList = ValidationDatum[];
-
-declare function ensure(...args: [...ValidationDatumList, EnsureOptions]): T;
-declare function ensure(...args: [...ValidationDatumList]): T;
-export default ensure;
diff --git a/system/websocket_test/node_modules/type/ts-types/error/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/error/ensure.d.ts
deleted file mode 100644
index b42f446..0000000
--- a/system/websocket_test/node_modules/type/ts-types/error/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureError(value: any, options?: EnsureBaseOptions): Error;
-declare function ensureError(value: any, options?: EnsureBaseOptions & EnsureIsOptional): Error | null;
-declare function ensureError(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): Error;
-
-export default ensureError;
diff --git a/system/websocket_test/node_modules/type/ts-types/error/is.d.ts b/system/websocket_test/node_modules/type/ts-types/error/is.d.ts
deleted file mode 100644
index db64ea3..0000000
--- a/system/websocket_test/node_modules/type/ts-types/error/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isError(value: any): boolean;
-export default isError;
diff --git a/system/websocket_test/node_modules/type/ts-types/finite/coerce.d.ts b/system/websocket_test/node_modules/type/ts-types/finite/coerce.d.ts
deleted file mode 100644
index f1edc2d..0000000
--- a/system/websocket_test/node_modules/type/ts-types/finite/coerce.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function coerceToFinite(value: any): number | null;
-export default coerceToFinite;
diff --git a/system/websocket_test/node_modules/type/ts-types/finite/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/finite/ensure.d.ts
deleted file mode 100644
index 988c511..0000000
--- a/system/websocket_test/node_modules/type/ts-types/finite/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureFinite(value: any, options?: EnsureBaseOptions): number;
-declare function ensureFinite(value: any, options?: EnsureBaseOptions & EnsureIsOptional): number | null;
-declare function ensureFinite(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): number;
-
-export default ensureFinite;
diff --git a/system/websocket_test/node_modules/type/ts-types/function/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/function/ensure.d.ts
deleted file mode 100644
index 30839e5..0000000
--- a/system/websocket_test/node_modules/type/ts-types/function/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureFunction, EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureFunction(value: any, options?: EnsureBaseOptions): EnsureFunction;
-declare function ensureFunction(value: any, options?: EnsureBaseOptions & EnsureIsOptional): EnsureFunction | null;
-declare function ensureFunction(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): EnsureFunction;
-
-export default ensureFunction;
diff --git a/system/websocket_test/node_modules/type/ts-types/function/is.d.ts b/system/websocket_test/node_modules/type/ts-types/function/is.d.ts
deleted file mode 100644
index 9d94f95..0000000
--- a/system/websocket_test/node_modules/type/ts-types/function/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isFunction(value: any): boolean;
-export default isFunction;
diff --git a/system/websocket_test/node_modules/type/ts-types/integer/coerce.d.ts b/system/websocket_test/node_modules/type/ts-types/integer/coerce.d.ts
deleted file mode 100644
index 3bbb00f..0000000
--- a/system/websocket_test/node_modules/type/ts-types/integer/coerce.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function coerceToInteger(value: any): number | null;
-export default coerceToInteger;
diff --git a/system/websocket_test/node_modules/type/ts-types/integer/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/integer/ensure.d.ts
deleted file mode 100644
index 06f1c8a..0000000
--- a/system/websocket_test/node_modules/type/ts-types/integer/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureInteger(value: any, options?: EnsureBaseOptions): number;
-declare function ensureInteger(value: any, options?: EnsureBaseOptions & EnsureIsOptional): number | null;
-declare function ensureInteger(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault): number;
-
-export default ensureInteger;
diff --git a/system/websocket_test/node_modules/type/ts-types/iterable/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/iterable/ensure.d.ts
deleted file mode 100644
index 973d3ea..0000000
--- a/system/websocket_test/node_modules/type/ts-types/iterable/ensure.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { EnsureFunction, EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-type IterableEnsureOptions = { ensureItem?: EnsureFunction, allowString?: boolean, denyEmpty?: boolean};
-
-
-declare function ensureIterable(value: any, options?: IterableEnsureOptions & EnsureBaseOptions): T[];
-declare function ensureIterable(value: any, options?: IterableEnsureOptions & EnsureBaseOptions & EnsureIsOptional): T[] | null;
-declare function ensureIterable(value: any, options?: IterableEnsureOptions & EnsureBaseOptions & EnsureIsOptional & EnsureDefault): T[];
-
-export default ensureIterable;
diff --git a/system/websocket_test/node_modules/type/ts-types/iterable/is.d.ts b/system/websocket_test/node_modules/type/ts-types/iterable/is.d.ts
deleted file mode 100644
index 93686d2..0000000
--- a/system/websocket_test/node_modules/type/ts-types/iterable/is.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare function isIterable(value: any, options?: { allowString?: boolean, denyEmpty?: boolean }): boolean;
-export default isIterable;
diff --git a/system/websocket_test/node_modules/type/ts-types/map/ensure.d.ts b/system/websocket_test/node_modules/type/ts-types/map/ensure.d.ts
deleted file mode 100644
index 6a23851..0000000
--- a/system/websocket_test/node_modules/type/ts-types/map/ensure.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
-
-declare function ensureMap(value: any, options?: EnsureBaseOptions): Map;
-declare function ensureMap(value: any, options?: EnsureBaseOptions & EnsureIsOptional): Map | null;
-declare function ensureMap(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault