xjs-common 9.1.0 → 9.1.2

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.
@@ -127,7 +127,7 @@ var UFile;
127
127
  throw new xjs_err_1.XjsErr(s_errCode, "The destination directory is not found.");
128
128
  let cmd = "unzip", options = null, availableCmd = true;
129
129
  if (destDir)
130
- options = `-d ${destDir}`;
130
+ options = `-d "${destDir}"`;
131
131
  const check = () => { try {
132
132
  (0, child_process_1.execSync)(`${cmd} --help`, { stdio: "ignore" });
133
133
  }
@@ -72,15 +72,15 @@ var UString;
72
72
  }
73
73
  UString.is_yyyyMMdd = is_yyyyMMdd;
74
74
  function is_yyyyMMddhh(v) {
75
- return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])(0[1-9]|1\d|2[0-3])$/);
75
+ return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])$/);
76
76
  }
77
77
  UString.is_yyyyMMddhh = is_yyyyMMddhh;
78
78
  function is_yyyyMMddhhmm(v) {
79
- return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])(0[1-9]|1\d|2[0-3])[0-5]\d$/);
79
+ return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])[0-5]\d$/);
80
80
  }
81
81
  UString.is_yyyyMMddhhmm = is_yyyyMMddhhmm;
82
82
  function is_yyyyMMddhhmmss(v) {
83
- return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])(0[1-9]|1\d|2[0-3])[0-5]\d[0-5]\d$/);
83
+ return !!v?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])[0-5]\d[0-5]\d$/);
84
84
  }
85
85
  UString.is_yyyyMMddhhmmss = is_yyyyMMddhhmmss;
86
86
  })(UString = exports.UString || (exports.UString = {}));
@@ -216,7 +216,9 @@ class HttpResolverContext {
216
216
  const stream = fs.createWriteStream(dest);
217
217
  res.pipe(stream);
218
218
  stream.on("finish", () => stream.close());
219
- resolve({ headers: res.headers });
219
+ stream.on("close", () => resolve({ headers: res.headers }));
220
+ stream.on("error", reject);
221
+ return;
220
222
  }
221
223
  catch (e) {
222
224
  if (e instanceof xjs_err_1.XjsErr)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xjs-common",
3
- "version": "9.1.0",
3
+ "version": "9.1.2",
4
4
  "description": "library modules for nodejs + typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,4 +28,4 @@
28
28
  "ts-node": "^10.9.1",
29
29
  "typescript": "^4.9.5"
30
30
  }
31
- }
31
+ }