@e-mc/file-manager 0.11.11 → 0.11.13

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 +6 -4
  3. package/package.json +11 -11
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.11.11/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.11.13/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -306,15 +306,15 @@ NOTE: **FileManager** is a sub-class of [Host](https://www.npmjs.com/package/@e-
306
306
 
307
307
  ## References
308
308
 
309
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/squared.d.ts
310
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/asset.d.ts
311
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/core.d.ts
312
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/filemanager.d.ts
313
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/logger.d.ts
314
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/module.d.ts
315
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/node.d.ts
316
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/request.d.ts
317
- - https://www.unpkg.com/@e-mc/types@0.11.11/lib/settings.d.ts
309
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/squared.d.ts
310
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/asset.d.ts
311
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/core.d.ts
312
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/filemanager.d.ts
313
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/logger.d.ts
314
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/module.d.ts
315
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/node.d.ts
316
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/request.d.ts
317
+ - https://www.unpkg.com/@e-mc/types@0.11.13/lib/settings.d.ts
318
318
 
319
319
  * https://www.npmjs.com/package/@types/node
320
320
 
package/index.js CHANGED
@@ -175,9 +175,10 @@ function recurseDir(output, subDirs, options) {
175
175
  for (const item of items) {
176
176
  if (!item.isDirectory()) {
177
177
  const pathname = path.join(baseDir, item.name);
178
- if (!ignore.includes(pathname) && !(item.isSymbolicLink() && core_1.Host.isDir(pathname))) {
179
- output.push(pathname);
178
+ if (item.isSymbolicLink() && core_1.Host.isDir(pathname) || ignore.length > 0 && (core_1.Host.PLATFORM_WIN32 ? ignore.includes(pathname.toLowerCase()) : ignore.includes(pathname))) {
179
+ continue;
180
180
  }
181
+ output.push(pathname);
181
182
  }
182
183
  else if (recursive) {
183
184
  recurseDir(output, subDirs.concat(item.name), options);
@@ -547,7 +548,7 @@ async function doVerifyChecksum(root, from, options, nested) {
547
548
  const filename = path.basename(from);
548
549
  const files = [];
549
550
  from = joinRoot ? path.join(root, filename) : path.resolve(from);
550
- recurseDir(files, [root], { ignore: [...ignore, from], sortBy, recursive });
551
+ recurseDir(files, [root], { ignore: mapLower([...ignore, from]), sortBy, recursive });
551
552
  const items = fs.readFileSync(from, 'utf-8').split('\n').map(item => {
552
553
  const index = item.indexOf(' ');
553
554
  return [item.substring(0, index), path.join(root, item.substring(index + 1))];
@@ -682,6 +683,7 @@ const isCacheable = (item) => item.initialValue?.cacheable !== false;
682
683
  const getPmOptions = (value, { matchBase = value.startsWith('*') && !value.includes('/'), dot = false } = {}) => ({ matchBase, nocase: core_1.Host.PLATFORM_WIN32, dot });
683
684
  const hasIncremental = (value) => value === "etag" || value === "exists";
684
685
  const matchPathname = (value) => core_1.Host.PLATFORM_WIN32 ? value.toLowerCase() : value;
686
+ const mapLower = (values) => core_1.Host.PLATFORM_WIN32 ? values.map(value => value.toLowerCase()) : values;
685
687
  const equalAddress = (value, other) => value === other || decodeURIComponent(value) === decodeURIComponent(other);
686
688
  const formatPercent = (value) => Math.round(value).toString().padStart(3) + '%';
687
689
  const checkEOF = (value) => /\n$/.test(value) ? value : value + '\n';
@@ -1608,7 +1610,7 @@ class FileManager extends core_1.Host {
1608
1610
  try {
1609
1611
  const filename = path.basename(to);
1610
1612
  to = joinRoot ? path.join(root, to) : path.resolve(to);
1611
- recurseDir(result, [root], { ignore: [...ignore, to], sortBy, recursive });
1613
+ recurseDir(result, [root], { ignore: mapLower([...ignore, to]), sortBy, recursive });
1612
1614
  const output = [];
1613
1615
  for (const pathname of result = filterPaths(root, result, include, exclude, options)) {
1614
1616
  if (recursive === 1 && path.basename(pathname) === filename) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.11.11",
3
+ "version": "0.11.13",
4
4
  "description": "FileManager constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,17 +20,17 @@
20
20
  "license": "BSD-3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "0.11.11",
24
- "@e-mc/compress": "0.11.11",
25
- "@e-mc/core": "0.11.11",
26
- "@e-mc/document": "0.11.11",
27
- "@e-mc/image": "0.11.11",
28
- "@e-mc/request": "0.11.11",
29
- "@e-mc/task": "0.11.11",
30
- "@e-mc/types": "0.11.11",
31
- "@e-mc/watch": "0.11.11",
23
+ "@e-mc/cloud": "0.11.13",
24
+ "@e-mc/compress": "0.11.13",
25
+ "@e-mc/core": "0.11.13",
26
+ "@e-mc/document": "0.11.13",
27
+ "@e-mc/image": "0.11.13",
28
+ "@e-mc/request": "0.11.13",
29
+ "@e-mc/task": "0.11.13",
30
+ "@e-mc/types": "0.11.13",
31
+ "@e-mc/watch": "0.11.13",
32
32
  "chalk": "4.1.2",
33
33
  "diff": "^7.0.0",
34
- "picomatch": "^4.0.2"
34
+ "picomatch": "^4.0.3"
35
35
  }
36
36
  }