@zwa73/utils 1.0.182 → 1.0.183

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/UtilCom.js CHANGED
@@ -28,7 +28,7 @@ var UtilCom;
28
28
  //请求超时
29
29
  if (hasTimeLimit) {
30
30
  res.setTimeout(timeLimit, () => {
31
- UtilLogger_1.SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${timeLimit} ms`);
31
+ UtilLogger_1.SLogger.warn(`${flagName} 接收反馈超时: ${timeLimit} ms`);
32
32
  resolve(undefined);
33
33
  });
34
34
  }
@@ -60,13 +60,13 @@ var UtilCom;
60
60
  //请求超时
61
61
  if (hasTimeLimit) {
62
62
  req.setTimeout(timeLimit, () => {
63
- UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时(timeLimit): ${timeLimit} ms`);
64
- req.destroy();
65
- });
66
- req.on('timeout', () => {
67
- UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
63
+ UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时: ${timeLimit} ms`);
68
64
  req.destroy();
69
65
  });
66
+ //req.on('timeout', ()=>{
67
+ // SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
68
+ // req.destroy();
69
+ //});
70
70
  }
71
71
  req.on('error', (e) => {
72
72
  UtilLogger_1.SLogger.warn(`${flagName} 发送请求错误:${e}`);
@@ -36,7 +36,7 @@ type TimeoutOut<T> = Outcome<Timeout, Promise<T>>;
36
36
  export type RepeatPromiseResult<T> = {
37
37
  completed: T;
38
38
  /**还未完成的其他Promise 若是验证失败则会返回undefined */
39
- pending: Promise<T | undefined>[];
39
+ pending?: Promise<T | undefined>[];
40
40
  };
41
41
  /**遍历对象的回调函数
42
42
  * @param key - 字段名
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.182",
3
+ "version": "1.0.183",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/UtilCom.ts CHANGED
@@ -78,7 +78,7 @@ export async function comReq<T>(
78
78
  //请求超时
79
79
  if(hasTimeLimit){
80
80
  res.setTimeout(timeLimit!, ()=>{
81
- SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${timeLimit} ms`);
81
+ SLogger.warn(`${flagName} 接收反馈超时: ${timeLimit} ms`);
82
82
  resolve(undefined);
83
83
  });
84
84
  }
@@ -113,13 +113,13 @@ export async function comReq<T>(
113
113
  //请求超时
114
114
  if(hasTimeLimit){
115
115
  req.setTimeout(timeLimit!, ()=>{
116
- SLogger.warn(`${flagName} 发送请求超时(timeLimit): ${timeLimit} ms`);
117
- req.destroy();
118
- });
119
- req.on('timeout', ()=>{
120
- SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
116
+ SLogger.warn(`${flagName} 发送请求超时: ${timeLimit} ms`);
121
117
  req.destroy();
122
118
  });
119
+ //req.on('timeout', ()=>{
120
+ // SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
121
+ // req.destroy();
122
+ //});
123
123
  }
124
124
 
125
125
  req.on('error', (e)=>{
@@ -60,7 +60,7 @@ type PromiseResult<T> = {
60
60
  export type RepeatPromiseResult<T> = {
61
61
  completed:T;
62
62
  /**还未完成的其他Promise 若是验证失败则会返回undefined */
63
- pending:Promise<T|undefined>[];
63
+ pending?:Promise<T|undefined>[];
64
64
  }
65
65
 
66
66