cvitool 1.0.775 → 1.0.777

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/CHANGELOG.md CHANGED
@@ -11,13 +11,21 @@
11
11
  - 废弃getMediaFileType函数
12
12
 
13
13
  ## [1.0.773] - 2025-10-15
14
- ### perfected
14
+ ### Perfected
15
15
  - 完善获取文件类型函数返回定义
16
16
 
17
17
  ## [1.0.774] - 2025-10-15
18
- ### perfected
18
+ ### Perfected
19
19
  - 完善一些函数类型返回定义
20
20
 
21
21
  ## [1.0.775] - 2025-10-24
22
- ### fixed
23
- - 修复checkURLResource函数未返回错误提示信息问题
22
+ ### Fixed
23
+ - 修复checkURLResource函数未返回错误提示信息问题
24
+
25
+ ## [1.0.776] - 2025-10-24
26
+ ### Fixed
27
+ - 修改checkURLResource函数抛错逻辑
28
+
29
+ ## [1.0.777] - 2025-10-28
30
+ ### Added
31
+ - 添加弱url校验正则
@@ -70,6 +70,7 @@ declare const RegStr: {
70
70
  date: string;
71
71
  time: string;
72
72
  dateTime: string;
73
+ weakUrl: string;
73
74
  };
74
75
  /**
75
76
  * 获取一个随机字符串
@@ -48,7 +48,8 @@ const RegStr = {
48
48
  ratio: '^[1-9]\\d?:[1-9]\\d?$',
49
49
  date: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$',
50
50
  time: '^([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$',
51
- dateTime: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$'
51
+ dateTime: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$',
52
+ weakUrl: '^https?://.*$'
52
53
  };
53
54
  exports.RegStr = RegStr;
54
55
  /**
@@ -362,7 +363,7 @@ function checkURLResource(url, timeout) {
362
363
  res.resBody.destroy();
363
364
  }
364
365
  catch (e) {
365
- if (e.name === 'timeoutError') {
366
+ if (e.name !== 'statusCodeError') {
366
367
  throw e;
367
368
  }
368
369
  obj.isEffective = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cvitool",
3
- "version": "1.0.775",
3
+ "version": "1.0.777",
4
4
  "description": "cvitool",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/cutil.ts CHANGED
@@ -86,7 +86,8 @@ const RegStr = {
86
86
  ratio: '^[1-9]\\d?:[1-9]\\d?$',
87
87
  date: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$',
88
88
  time: '^([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$',
89
- dateTime: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$'
89
+ dateTime: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$',
90
+ weakUrl: '^https?://.*$'
90
91
  };
91
92
 
92
93
  /**
@@ -398,7 +399,7 @@ async function checkURLResource(url: string, timeout?: number) {
398
399
  const res = await hgo.get(url, { resType: 'stream', timeout });
399
400
  (res.resBody as Readable).destroy();
400
401
  } catch (e) {
401
- if (e.name === 'timeoutError') {
402
+ if (e.name !== 'statusCodeError') {
402
403
  throw e;
403
404
  }
404
405
  obj.isEffective = false;