@e-mc/file-manager 0.10.11 → 0.10.12

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 +10 -10
  2. package/index.js +5 -4
  3. package/package.json +10 -10
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.11/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.12/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -305,15 +305,15 @@ NOTE: **FileManager** is a sub-class of [Host](https://www.npmjs.com/package/@e-
305
305
 
306
306
  ## References
307
307
 
308
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/squared.d.ts
309
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/asset.d.ts
310
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/core.d.ts
311
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/filemanager.d.ts
312
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/logger.d.ts
313
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/module.d.ts
314
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/node.d.ts
315
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/request.d.ts
316
- - https://www.unpkg.com/@e-mc/types@0.10.11/lib/settings.d.ts
308
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/squared.d.ts
309
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/asset.d.ts
310
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/core.d.ts
311
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/filemanager.d.ts
312
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/logger.d.ts
313
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/module.d.ts
314
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/node.d.ts
315
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/request.d.ts
316
+ - https://www.unpkg.com/@e-mc/types@0.10.12/lib/settings.d.ts
317
317
 
318
318
  * https://www.npmjs.com/package/@types/node
319
319
 
package/index.js CHANGED
@@ -224,8 +224,8 @@ function validatePaths(rootDir, values, patterns, include, dot) {
224
224
  value = value.substring(1);
225
225
  invert = true;
226
226
  }
227
- const matchBase = !isMatchRoot(value = core_1.Permission.toPosix(value));
228
- return [pm(value, { posixSlashes: true, windows: true, nocase: core_1.Host.PLATFORM_WIN32, dot, matchBase }), path.isAbsolute(value), invert];
227
+ value = core_1.Permission.toPosix(value);
228
+ return [pm(value, getPmOptions(value, dot)), path.isAbsolute(value), invert];
229
229
  });
230
230
  return values.filter(value => {
231
231
  for (const [pattern, absolute, invert] of items) {
@@ -680,7 +680,7 @@ function setLogMinWidth() {
680
680
  }
681
681
  const closeResponse = (client) => client?.destroy();
682
682
  const isCacheable = (item) => item.initialValue?.cacheable !== false;
683
- const isMatchRoot = (value) => !value.startsWith('*') && /[\\/]/.test(value);
683
+ const getPmOptions = (value, dot = false) => ({ nocase: core_1.Host.PLATFORM_WIN32, matchBase: value.startsWith('*') && !value.includes('/'), dot });
684
684
  const hasIncremental = (value) => value === "etag" || value === "exists";
685
685
  const matchPathname = (value) => core_1.Host.PLATFORM_WIN32 ? value.toLowerCase() : value;
686
686
  const sanitizePath = (value) => value.replace(/(?:^\\|\\+)/g, '/');
@@ -1803,7 +1803,8 @@ class FileManager extends core_1.Host {
1803
1803
  if (!(0, types_1.hasGlob)(item)) {
1804
1804
  return item;
1805
1805
  }
1806
- return isMatchRoot(item) ? pm(core_1.Permission.toPosix(item), { nocase: core_1.Host.PLATFORM_WIN32 }) : pm(sanitizePath(item), { matchBase: true, nocase: core_1.Host.PLATFORM_WIN32 });
1806
+ const value = core_1.Permission.toPosix(item);
1807
+ return pm(value, getPmOptions(value));
1807
1808
  }),
1808
1809
  {}
1809
1810
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
4
4
  "description": "FileManager constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,15 +20,15 @@
20
20
  "license": "BSD-3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "0.10.11",
24
- "@e-mc/compress": "0.10.11",
25
- "@e-mc/core": "0.10.11",
26
- "@e-mc/document": "0.10.11",
27
- "@e-mc/image": "0.10.11",
28
- "@e-mc/request": "0.10.11",
29
- "@e-mc/task": "0.10.11",
30
- "@e-mc/types": "0.10.11",
31
- "@e-mc/watch": "0.10.11",
23
+ "@e-mc/cloud": "0.10.12",
24
+ "@e-mc/compress": "0.10.12",
25
+ "@e-mc/core": "0.10.12",
26
+ "@e-mc/document": "0.10.12",
27
+ "@e-mc/image": "0.10.12",
28
+ "@e-mc/request": "0.10.12",
29
+ "@e-mc/task": "0.10.12",
30
+ "@e-mc/types": "0.10.12",
31
+ "@e-mc/watch": "0.10.12",
32
32
  "chalk": "4.1.2",
33
33
  "diff": "^5.2.0",
34
34
  "picomatch": "^4.0.2",