@e-mc/module 0.8.25 → 0.8.26

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.
Files changed (3) hide show
  1. package/README.md +5 -5
  2. package/index.js +12 -6
  3. 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.25/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.26/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.25/lib/core.d.ts
235
- - https://www.unpkg.com/@e-mc/types@0.8.25/lib/logger.d.ts
236
- - https://www.unpkg.com/@e-mc/types@0.8.25/lib/module.d.ts
237
- - https://www.unpkg.com/@e-mc/types@0.8.25/lib/node.d.ts
234
+ - https://www.unpkg.com/@e-mc/types@0.8.26/lib/core.d.ts
235
+ - https://www.unpkg.com/@e-mc/types@0.8.26/lib/logger.d.ts
236
+ - https://www.unpkg.com/@e-mc/types@0.8.26/lib/module.d.ts
237
+ - https://www.unpkg.com/@e-mc/types@0.8.26/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.25"; }
720
+ static get VERSION() { return "0.8.26"; }
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, convert = true;
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 (convert) {
1315
+ if (PLATFORM_WIN32) {
1317
1316
  pathname = pathname.replace(/(?:^\\|\\+)/g, '/');
1318
1317
  }
1319
- if (pathname = pathname.replace(/\/+$/, '')) {
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
- return pathname + (filename ? '/' + filename : '');
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 || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.8.25",
3
+ "version": "0.8.26",
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.25",
23
+ "@e-mc/types": "0.8.26",
24
24
  "abort-controller": "^3.0.0",
25
25
  "chalk": "4.1.2",
26
26
  "event-target-shim": "^5.0.1",