cvitool 1.0.778 → 1.0.779

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
@@ -32,4 +32,8 @@
32
32
 
33
33
  ## [1.0.778] - 2025-10-28
34
34
  ### Fixed
35
- - 修复validate函数string型允许为空情况下去校验regex的问题
35
+ - 修复validate函数string型允许为空情况下去校验regex的问题
36
+
37
+ ## [1.0.779] - 2025-10-29
38
+ ### Fixed
39
+ - 修复checkURLResource函数请求发生ENOTFOUND时抛错问题
@@ -363,7 +363,7 @@ function checkURLResource(url, timeout) {
363
363
  res.resBody.destroy();
364
364
  }
365
365
  catch (e) {
366
- if (e.name !== 'statusCodeError') {
366
+ if (e.name !== 'statusCodeError' && !['ENOTFOUND'].includes(e.code)) {
367
367
  throw e;
368
368
  }
369
369
  obj.isEffective = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cvitool",
3
- "version": "1.0.778",
3
+ "version": "1.0.779",
4
4
  "description": "cvitool",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/cutil.ts CHANGED
@@ -399,7 +399,7 @@ async function checkURLResource(url: string, timeout?: number) {
399
399
  const res = await hgo.get(url, { resType: 'stream', timeout });
400
400
  (res.resBody as Readable).destroy();
401
401
  } catch (e) {
402
- if (e.name !== 'statusCodeError') {
402
+ if (e.name !== 'statusCodeError' && !['ENOTFOUND'].includes(e.code)) {
403
403
  throw e;
404
404
  }
405
405
  obj.isEffective = false;