@domain.js/main 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http/index.js +1 -1
- package/dist/utils/index.d.ts +7 -2
- package/dist/utils/index.js +8 -3
- package/package.json +1 -1
package/dist/http/index.js
CHANGED
|
@@ -54,7 +54,7 @@ function Main(cnf, deps) {
|
|
|
54
54
|
socketLogger("emit", socket.id, args);
|
|
55
55
|
return emit.apply(socket, args);
|
|
56
56
|
};
|
|
57
|
-
socketLogger("connection", socket.id);
|
|
57
|
+
socketLogger("connection", socket.id, socket.handshake);
|
|
58
58
|
socket.use((args, next) => {
|
|
59
59
|
next();
|
|
60
60
|
socketLogger("use", socket.id, args);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -64,9 +64,9 @@ export declare const tryCatchLog: TryCatchLogFn;
|
|
|
64
64
|
* @returns true or false
|
|
65
65
|
*/
|
|
66
66
|
export declare const inExpired: (time: number, life: number) => boolean;
|
|
67
|
-
|
|
67
|
+
interface Params {
|
|
68
68
|
[K: string]: string;
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
/**
|
|
71
71
|
* Modify a URL address, add some attributes and delete some attributes
|
|
72
72
|
* @param address URL address
|
|
@@ -74,6 +74,11 @@ declare type Params = {
|
|
|
74
74
|
* @param removes The string list will be remove from address
|
|
75
75
|
* @returns Modified address
|
|
76
76
|
*/
|
|
77
|
+
export declare const modifyURL: (address: string, adds?: Params | undefined, removes?: string[] | undefined) => string;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated
|
|
80
|
+
* alias modifyURL
|
|
81
|
+
*/
|
|
77
82
|
export declare const modifiyURL: (address: string, adds?: Params | undefined, removes?: string[] | undefined) => string;
|
|
78
83
|
/**
|
|
79
84
|
* 等待,知道 test 返回 true
|
package/dist/utils/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.deepReaddir = exports.waitFor = exports.modifiyURL = exports.inExpired = exports.tryCatchLog = exports.deepFreeze = exports.sleep = exports.lcfirst = exports.ucfirst = exports.nt2space = exports.randStr = exports.md5 = void 0;
|
|
25
|
+
exports.deepReaddir = exports.waitFor = exports.modifiyURL = exports.modifyURL = exports.inExpired = exports.tryCatchLog = exports.deepFreeze = exports.sleep = exports.lcfirst = exports.ucfirst = exports.nt2space = exports.randStr = exports.md5 = void 0;
|
|
26
26
|
const async_1 = __importDefault(require("async"));
|
|
27
27
|
const crypto = __importStar(require("crypto"));
|
|
28
28
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -138,7 +138,7 @@ exports.inExpired = inExpired;
|
|
|
138
138
|
* @param removes The string list will be remove from address
|
|
139
139
|
* @returns Modified address
|
|
140
140
|
*/
|
|
141
|
-
const
|
|
141
|
+
const modifyURL = (address, adds, removes) => {
|
|
142
142
|
const obj = new URL(address);
|
|
143
143
|
if (typeof adds === "object") {
|
|
144
144
|
for (const key of Object.keys(adds)) {
|
|
@@ -151,7 +151,12 @@ const modifiyURL = (address, adds, removes) => {
|
|
|
151
151
|
}
|
|
152
152
|
return obj.toString();
|
|
153
153
|
};
|
|
154
|
-
exports.
|
|
154
|
+
exports.modifyURL = modifyURL;
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated
|
|
157
|
+
* alias modifyURL
|
|
158
|
+
*/
|
|
159
|
+
exports.modifiyURL = exports.modifyURL;
|
|
155
160
|
/**
|
|
156
161
|
* 等待,知道 test 返回 true
|
|
157
162
|
* @param test 检测函数
|