cgserver 6.5.8 → 6.5.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/README.md +2 -0
- package/dist/lib/Logic/Log.js +4 -4
- package/dist/types/Logic/Log.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/lib/Logic/Log.js
CHANGED
|
@@ -95,15 +95,15 @@ class Log {
|
|
|
95
95
|
_isNumber(param) {
|
|
96
96
|
return typeof (param) === "number";
|
|
97
97
|
}
|
|
98
|
-
_format
|
|
99
|
-
if (this.
|
|
98
|
+
_format(src, formatStr) {
|
|
99
|
+
if (this._isString(src)) {
|
|
100
100
|
let args = Array.prototype.slice.call(arguments, 1);
|
|
101
101
|
return src.replace(/\{(\d+)\}/g, function (m, i) {
|
|
102
102
|
return args[i];
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
|
-
if (this.
|
|
106
|
+
if (this._isNumber(src)) {
|
|
107
107
|
src = new Date(src);
|
|
108
108
|
}
|
|
109
109
|
let str = formatStr;
|
|
@@ -130,6 +130,6 @@ class Log {
|
|
|
130
130
|
str = str.replace(/s|S/g, sec);
|
|
131
131
|
return str;
|
|
132
132
|
}
|
|
133
|
-
}
|
|
133
|
+
}
|
|
134
134
|
}
|
|
135
135
|
exports.GLog = new Log();
|
|
@@ -20,6 +20,6 @@ declare class Log {
|
|
|
20
20
|
protected _isObject(param: any): boolean;
|
|
21
21
|
protected _isString(param: any): boolean;
|
|
22
22
|
protected _isNumber(param: any): boolean;
|
|
23
|
-
protected _format
|
|
23
|
+
protected _format(src: any, formatStr: any): any;
|
|
24
24
|
}
|
|
25
25
|
export {};
|