@e-mc/module 0.6.17 → 0.6.19
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.6.
|
|
592
|
+
static get VERSION() { return "0.6.19"; }
|
|
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; }
|
|
@@ -1142,22 +1142,28 @@ class Module extends EventEmitter {
|
|
|
1142
1142
|
filename = undefined;
|
|
1143
1143
|
}
|
|
1144
1144
|
if (typeof value === 'string') {
|
|
1145
|
-
let pathname = PLATFORM_WIN32 ? value.trim() : value
|
|
1145
|
+
let pathname = PLATFORM_WIN32 ? value.trim() : value;
|
|
1146
1146
|
if (normalize) {
|
|
1147
1147
|
pathname = path.normalize(pathname);
|
|
1148
|
-
convert = PLATFORM_WIN32;
|
|
1149
1148
|
}
|
|
1150
|
-
if (
|
|
1149
|
+
if (PLATFORM_WIN32) {
|
|
1151
1150
|
pathname = pathname.replace(/(?:^\\|\\+)/g, '/');
|
|
1152
1151
|
}
|
|
1153
|
-
if (pathname
|
|
1152
|
+
if (pathname) {
|
|
1153
|
+
pathname = pathname.replace(/(?<!^)\/+$/, '');
|
|
1154
1154
|
if (normalize && PLATFORM_WIN32) {
|
|
1155
1155
|
const match = /^([A-Z]):\//.exec(pathname);
|
|
1156
1156
|
if (match) {
|
|
1157
1157
|
pathname = match[1].toLowerCase() + pathname.substring(1);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
|
|
1160
|
+
if (!filename) {
|
|
1161
|
+
return pathname;
|
|
1162
|
+
}
|
|
1163
|
+
if (pathname !== '/') {
|
|
1164
|
+
pathname += '/';
|
|
1165
|
+
}
|
|
1166
|
+
return pathname + filename;
|
|
1161
1167
|
}
|
|
1162
1168
|
}
|
|
1163
1169
|
return filename || '';
|
|
@@ -2209,7 +2215,7 @@ class Module extends EventEmitter {
|
|
|
2209
2215
|
dir = dir.substring(ensureDir(PROCESS_CWD).length);
|
|
2210
2216
|
}
|
|
2211
2217
|
else {
|
|
2212
|
-
this.formatMessage(1, 'WARN',
|
|
2218
|
+
this.formatMessage(1, 'WARN', "Not permitted to set absolute path", dir, { ...this.LOG_STYLE_WARN, newline: true });
|
|
2213
2219
|
dir = undefined;
|
|
2214
2220
|
}
|
|
2215
2221
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/module",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
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.6.
|
|
23
|
+
"@e-mc/types": "0.6.19",
|
|
24
24
|
"abort-controller": "^3.0.0",
|
|
25
25
|
"chalk": "4.1.2",
|
|
26
26
|
"event-target-shim": "^5.0.1",
|