فهرست منبع

update ts to 3.7.3

afrokick 5 سال پیش
والد
کامیت
ed6379c160
6فایلهای تغییر یافته به همراه345 افزوده شده و 334 حذف شده
  1. 2 1
      .eslintrc.json
  2. 2 2
      dist/src/index.js
  3. 6 3
      dist/src/models/realm.js
  4. 312 298
      package-lock.json
  5. 19 19
      package.json
  6. 4 11
      tsconfig.json

+ 2 - 1
.eslintrc.json

@@ -17,6 +17,7 @@
     "rules": {
         "no-var": "error",
         "no-console": "off",
-        "@typescript-eslint/camelcase": "off"
+        "@typescript-eslint/camelcase": "off",
+        "@typescript-eslint/interface-name-prefix": "off"
     }
 }

+ 2 - 2
dist/src/index.js

@@ -59,7 +59,7 @@ const init = ({ app, server, options }) => {
 };
 function ExpressPeerServer(server, options) {
     const app = express_1.default();
-    const newOptions = Object.assign({}, config_1.default, options);
+    const newOptions = Object.assign(Object.assign({}, config_1.default), options);
     if (newOptions.proxied) {
         app.set("trust proxy", newOptions.proxied === "false" ? false : !!newOptions.proxied);
     }
@@ -75,7 +75,7 @@ function ExpressPeerServer(server, options) {
 exports.ExpressPeerServer = ExpressPeerServer;
 function PeerServer(options = {}, callback) {
     const app = express_1.default();
-    const newOptions = Object.assign({}, config_1.default, options);
+    const newOptions = Object.assign(Object.assign({}, config_1.default), options);
     let path = newOptions.path;
     const port = newOptions.port;
     if (path[0] !== "/") {

+ 6 - 3
dist/src/models/realm.js

@@ -1,5 +1,9 @@
 "use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
 Object.defineProperty(exports, "__esModule", { value: true });
+const v4_1 = __importDefault(require("uuid/v4"));
 const messageQueue_1 = require("./messageQueue");
 class Realm {
     constructor() {
@@ -39,10 +43,9 @@ class Realm {
         this.messageQueues.delete(id);
     }
     generateClientId() {
-        const randomId = () => (Math.random().toString(36) + "0000000000000000000").substr(2, 16);
-        let clientId = randomId();
+        let clientId = v4_1.default();
         while (this.getClientById(clientId)) {
-            clientId = randomId();
+            clientId = v4_1.default();
         }
         return clientId;
     }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 312 - 298
package-lock.json


+ 19 - 19
package.json

@@ -27,32 +27,32 @@
     "branch": "master"
   },
   "dependencies": {
-    "@types/cors": "^2.8.6",
-    "@types/express": "^4.17.1",
-    "@types/ws": "^6.0.2",
-    "body-parser": "^1.19.0",
-    "cors": "~2.8.4",
-    "express": "^4.17.1",
-    "optimist": "~0.6.1",
+    "@types/cors": "2.8.6",
+    "@types/express": "4.17.1",
+    "@types/ws": "6.0.4",
+    "body-parser": "1.19.0",
+    "cors": "2.8.4",
+    "express": "4.17.1",
+    "optimist": "0.6.1",
     "uuid": "3.3.3",
-    "ws": "^7.1.2"
+    "ws": "7.1.2"
   },
   "devDependencies": {
     "@types/chai": "^4.1.7",
     "@types/mocha": "^5.2.7",
     "@types/node": "^10.14.16",
-    "@types/uuid": "^3.4.6",
-    "@typescript-eslint/eslint-plugin": "^2.0.0",
-    "@typescript-eslint/parser": "^2.0.0",
+    "@types/uuid": "3.4.6",
+    "@typescript-eslint/eslint-plugin": "^2.11.0",
+    "@typescript-eslint/parser": "^2.11.0",
     "chai": "^4.2.0",
-    "eslint": "^6.2.1",
-    "mocha": "^6.2.0",
-    "nodemon": "^1.19.1",
-    "npm-run-all": "^4.1.5",
-    "rimraf": "^3.0.0",
-    "sinon": "^7.4.1",
-    "ts-node": "^8.3.0",
-    "typescript": "^3.5.3"
+    "eslint": "^6.7.2",
+    "mocha": "^6.2.2",
+    "nodemon": "1.19.1",
+    "npm-run-all": "4.1.5",
+    "rimraf": "3.0.0",
+    "sinon": "7.5.0",
+    "ts-node": "8.5.4",
+    "typescript": "3.7.3"
   },
   "engines": {
     "node": ">=10"

+ 4 - 11
tsconfig.json

@@ -1,10 +1,7 @@
 {
     "compilerOptions": {
         "lib": [
-            "es5",
-            "es6",
-            "es7",
-            "es2017"
+            "esnext"
         ],
         "target": "es2016",
         "module": "commonjs",
@@ -16,15 +13,11 @@
         "noUnusedParameters": true,
         "resolveJsonModule": true,
         "skipLibCheck": true,
-        "outDir": "dist",
         "sourceMap": false,
+        "outDir": "dist"
     },
-    "include": [
-        "./src/**/*",
-    ],
     "exclude": [
-        "./test/",
-        "./node_modules/",
-        "./bin/",
+        "test",
+        "bin",
     ]
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است