@e-mc/module 0.8.25 → 0.8.27
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/README.md +5 -5
- package/index.js +13 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
12
|
+
- https://www.unpkg.com/@e-mc/types@0.8.27/lib/index.d.ts
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogStatus } from "./squared";
|
|
@@ -231,10 +231,10 @@ interface ModuleConstructor {
|
|
|
231
231
|
|
|
232
232
|
## References
|
|
233
233
|
|
|
234
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
235
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
236
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
237
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
234
|
+
- https://www.unpkg.com/@e-mc/types@0.8.27/lib/core.d.ts
|
|
235
|
+
- https://www.unpkg.com/@e-mc/types@0.8.27/lib/logger.d.ts
|
|
236
|
+
- https://www.unpkg.com/@e-mc/types@0.8.27/lib/module.d.ts
|
|
237
|
+
- https://www.unpkg.com/@e-mc/types@0.8.27/lib/node.d.ts
|
|
238
238
|
|
|
239
239
|
## LICENSE
|
|
240
240
|
|
package/index.js
CHANGED
|
@@ -717,7 +717,7 @@ class Module extends EventEmitter {
|
|
|
717
717
|
this[_f] = new AbortController();
|
|
718
718
|
this[_g] = null;
|
|
719
719
|
}
|
|
720
|
-
static get VERSION() { return "0.8.
|
|
720
|
+
static get VERSION() { return "0.8.27"; }
|
|
721
721
|
static get LOG_TYPE() { return types_1.LOG_TYPE; }
|
|
722
722
|
static get STATUS_TYPE() { return types_1.STATUS_TYPE; }
|
|
723
723
|
static get MAX_TIMEOUT() { return 2147483647; }
|
|
@@ -1308,22 +1308,28 @@ class Module extends EventEmitter {
|
|
|
1308
1308
|
filename = undefined;
|
|
1309
1309
|
}
|
|
1310
1310
|
if (typeof value === 'string') {
|
|
1311
|
-
let pathname = PLATFORM_WIN32 ? value.trim() : value
|
|
1311
|
+
let pathname = PLATFORM_WIN32 ? value.trim() : value;
|
|
1312
1312
|
if (normalize) {
|
|
1313
1313
|
pathname = path.normalize(pathname);
|
|
1314
|
-
convert = PLATFORM_WIN32;
|
|
1315
1314
|
}
|
|
1316
|
-
if (
|
|
1315
|
+
if (PLATFORM_WIN32) {
|
|
1317
1316
|
pathname = pathname.replace(/(?:^\\|\\+)/g, '/');
|
|
1318
1317
|
}
|
|
1319
|
-
if (pathname
|
|
1318
|
+
if (pathname) {
|
|
1319
|
+
pathname = pathname.replace(/(?<!^)\/+$/, '');
|
|
1320
1320
|
if (normalize && PLATFORM_WIN32) {
|
|
1321
1321
|
const match = /^([A-Z]):\//.exec(pathname);
|
|
1322
1322
|
if (match) {
|
|
1323
1323
|
pathname = match[1].toLowerCase() + pathname.substring(1);
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
|
-
|
|
1326
|
+
if (!filename) {
|
|
1327
|
+
return pathname;
|
|
1328
|
+
}
|
|
1329
|
+
if (pathname !== '/') {
|
|
1330
|
+
pathname += '/';
|
|
1331
|
+
}
|
|
1332
|
+
return pathname + filename;
|
|
1327
1333
|
}
|
|
1328
1334
|
}
|
|
1329
1335
|
return filename || '';
|
|
@@ -2478,7 +2484,7 @@ class Module extends EventEmitter {
|
|
|
2478
2484
|
dir = dir.substring(ensureDir(PROCESS_CWD).length);
|
|
2479
2485
|
}
|
|
2480
2486
|
else {
|
|
2481
|
-
this.formatMessage(1, 'WARN',
|
|
2487
|
+
this.formatMessage(1, 'WARN', "Not permitted to set absolute path", dir, { ...this.LOG_STYLE_WARN, newline: true });
|
|
2482
2488
|
dir = undefined;
|
|
2483
2489
|
}
|
|
2484
2490
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/module",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.27",
|
|
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.8.
|
|
23
|
+
"@e-mc/types": "0.8.27",
|
|
24
24
|
"abort-controller": "^3.0.0",
|
|
25
25
|
"chalk": "4.1.2",
|
|
26
26
|
"event-target-shim": "^5.0.1",
|