@e-mc/module 0.7.21 → 0.7.23
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/index.js +13 -7
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -589,7 +589,7 @@ class Module extends EventEmitter {
|
|
|
589
589
|
this[_f] = new AbortController();
|
|
590
590
|
this[_g] = null;
|
|
591
591
|
}
|
|
592
|
-
static get VERSION() { return "0.7.
|
|
592
|
+
static get VERSION() { return "0.7.23"; }
|
|
593
593
|
static get LOG_TYPE() { return types_1.LOG_TYPE; }
|
|
594
594
|
static get STATUS_TYPE() { return types_1.STATUS_TYPE; }
|
|
595
595
|
static get MAX_TIMEOUT() { return 2147483647; }
|
|
@@ -1173,22 +1173,28 @@ class Module extends EventEmitter {
|
|
|
1173
1173
|
filename = undefined;
|
|
1174
1174
|
}
|
|
1175
1175
|
if (typeof value === 'string') {
|
|
1176
|
-
let pathname = PLATFORM_WIN32 ? value.trim() : value
|
|
1176
|
+
let pathname = PLATFORM_WIN32 ? value.trim() : value;
|
|
1177
1177
|
if (normalize) {
|
|
1178
1178
|
pathname = path.normalize(pathname);
|
|
1179
|
-
convert = PLATFORM_WIN32;
|
|
1180
1179
|
}
|
|
1181
|
-
if (
|
|
1180
|
+
if (PLATFORM_WIN32) {
|
|
1182
1181
|
pathname = pathname.replace(/(?:^\\|\\+)/g, '/');
|
|
1183
1182
|
}
|
|
1184
|
-
if (pathname
|
|
1183
|
+
if (pathname) {
|
|
1184
|
+
pathname = pathname.replace(/(?<!^)\/+$/, '');
|
|
1185
1185
|
if (normalize && PLATFORM_WIN32) {
|
|
1186
1186
|
const match = /^([A-Z]):\//.exec(pathname);
|
|
1187
1187
|
if (match) {
|
|
1188
1188
|
pathname = match[1].toLowerCase() + pathname.substring(1);
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
|
-
|
|
1191
|
+
if (!filename) {
|
|
1192
|
+
return pathname;
|
|
1193
|
+
}
|
|
1194
|
+
if (pathname !== '/') {
|
|
1195
|
+
pathname += '/';
|
|
1196
|
+
}
|
|
1197
|
+
return pathname + filename;
|
|
1192
1198
|
}
|
|
1193
1199
|
}
|
|
1194
1200
|
return filename || '';
|
|
@@ -2241,7 +2247,7 @@ class Module extends EventEmitter {
|
|
|
2241
2247
|
dir = dir.substring(ensureDir(PROCESS_CWD).length);
|
|
2242
2248
|
}
|
|
2243
2249
|
else {
|
|
2244
|
-
this.formatMessage(1, 'WARN',
|
|
2250
|
+
this.formatMessage(1, 'WARN', "Not permitted to set absolute path", dir, { ...this.LOG_STYLE_WARN, newline: true });
|
|
2245
2251
|
dir = undefined;
|
|
2246
2252
|
}
|
|
2247
2253
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/module",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.23",
|
|
4
4
|
"description": "Module base class for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/types": "0.7.
|
|
23
|
+
"@e-mc/types": "0.7.23",
|
|
24
24
|
"abort-controller": "^3.0.0",
|
|
25
25
|
"chalk": "4.1.2",
|
|
26
26
|
"event-target-shim": "^5.0.1",
|