update ts to 3.7.3

This commit is contained in:
afrokick 2019-12-15 13:48:45 +03:00
parent 17e0177670
commit ed6379c160
6 changed files with 459 additions and 442 deletions

View File

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

4
dist/src/index.js vendored
View File

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

View File

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

832
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

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