@e-mc/module 0.10.4 → 0.10.6

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 +6 -6
  2. package/index.js +4 -9
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.10.4/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.6/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -407,11 +407,11 @@ interface LoggerModule {
407
407
 
408
408
  ## References
409
409
 
410
- - https://www.unpkg.com/@e-mc/types@0.10.4/lib/core.d.ts
411
- - https://www.unpkg.com/@e-mc/types@0.10.4/lib/logger.d.ts
412
- - https://www.unpkg.com/@e-mc/types@0.10.4/lib/module.d.ts
413
- - https://www.unpkg.com/@e-mc/types@0.10.4/lib/node.d.ts
414
- - https://www.unpkg.com/@e-mc/types@0.10.4/lib/settings.d.ts
410
+ - https://www.unpkg.com/@e-mc/types@0.10.6/lib/core.d.ts
411
+ - https://www.unpkg.com/@e-mc/types@0.10.6/lib/logger.d.ts
412
+ - https://www.unpkg.com/@e-mc/types@0.10.6/lib/module.d.ts
413
+ - https://www.unpkg.com/@e-mc/types@0.10.6/lib/node.d.ts
414
+ - https://www.unpkg.com/@e-mc/types@0.10.6/lib/settings.d.ts
415
415
 
416
416
  * https://www.npmjs.com/package/@types/node
417
417
 
package/index.js CHANGED
@@ -634,7 +634,8 @@ function listDir(src, paths, depth, include, exclude, excludeDir, outFiles) {
634
634
  fs.readdirSync(srcDir, { withFileTypes: true }).forEach(file => {
635
635
  if (file.isFile()) {
636
636
  const pathname = path.join(srcDir, file.name);
637
- if (include(pathname) && !exclude?.(pathname)) {
637
+ const pathglob = pathname.substring(src.length);
638
+ if (include(pathglob) && !exclude?.(pathglob)) {
638
639
  outFiles.push(pathname);
639
640
  }
640
641
  }
@@ -960,7 +961,7 @@ class Module extends EventEmitter {
960
961
  this[_g] = null;
961
962
  }
962
963
  static get VERSION() {
963
- return "0.10.4";
964
+ return "0.10.6";
964
965
  }
965
966
  static get LOG_TYPE() {
966
967
  return types_1.LOG_TYPE;
@@ -1927,12 +1928,6 @@ class Module extends EventEmitter {
1927
1928
  return Promise.reject(errorDirectory(asFile(src) || "Unknown"));
1928
1929
  }
1929
1930
  const pmOpts = { posixSlashes: true, windows: true, nocase: PLATFORM_WIN32 };
1930
- const prependSrc = (value) => {
1931
- if (pmOpts.matchBase) {
1932
- return value;
1933
- }
1934
- return (Array.isArray(value) ? value : [value]).map(item => path.join(outDir, item));
1935
- };
1936
1931
  let exclude, excludeDir, recursive;
1937
1932
  if ((0, types_1.isObject)(options)) {
1938
1933
  if (options.matchBase) {
@@ -1963,7 +1958,7 @@ class Module extends EventEmitter {
1963
1958
  }
1964
1959
  recursive ??= true;
1965
1960
  const result = [];
1966
- listDir(outDir, [], !recursive ? 0 : typeof recursive === 'number' ? recursive : Infinity, pm(prependSrc(pattern), pmOpts), exclude?.length ? pm(prependSrc(exclude), pmOpts) : undefined, excludeDir, result);
1961
+ listDir(ensureDir(outDir), [], !recursive ? 0 : typeof recursive === 'number' ? recursive : Infinity, pm(pattern, pmOpts), exclude?.length ? pm(exclude, pmOpts) : undefined, excludeDir, result);
1967
1962
  return result;
1968
1963
  }
1969
1964
  static renameFile(src, dest, throws = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
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": "BSD-3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/types": "0.10.4",
23
+ "@e-mc/types": "0.10.6",
24
24
  "chalk": "4.1.2",
25
25
  "file-type": "^18.7.0",
26
26
  "js-yaml": "^4.1.0",