@e-mc/file-manager 0.9.5 → 0.9.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 +10 -10
  2. package/index.js +11 -11
  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.9.5/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.9.6/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -286,15 +286,15 @@ NOTE: **FileManager** is a sub-class of [Host](https://www.npmjs.com/package/@e-
286
286
 
287
287
  ## References
288
288
 
289
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/squared.d.ts
290
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/asset.d.ts
291
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/core.d.ts
292
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/filemanager.d.ts
293
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/logger.d.ts
294
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/module.d.ts
295
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/node.d.ts
296
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/request.d.ts
297
- - https://www.unpkg.com/@e-mc/types@0.9.5/lib/settings.d.ts
289
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/squared.d.ts
290
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/asset.d.ts
291
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/core.d.ts
292
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/filemanager.d.ts
293
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/logger.d.ts
294
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/module.d.ts
295
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/node.d.ts
296
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/request.d.ts
297
+ - https://www.unpkg.com/@e-mc/types@0.9.6/lib/settings.d.ts
298
298
 
299
299
  * https://www.npmjs.com/package/@types/node
300
300
 
package/index.js CHANGED
@@ -1778,25 +1778,25 @@ class FileManager extends core_1.Host {
1778
1778
  }
1779
1779
  }
1780
1780
  file.fetchType = type;
1781
+ if (file.document) {
1782
+ for (const { instance } of this.Document) {
1783
+ if (this.hasDocument(instance, file.document)) {
1784
+ instance.setLocalUri?.(file, replace);
1785
+ }
1786
+ }
1787
+ }
1781
1788
  const segments = [];
1782
1789
  if (file.moveTo) {
1783
1790
  segments.push(file.moveTo);
1784
1791
  }
1785
1792
  if (file.pathname) {
1786
- segments.push(file.pathname = core_1.Host.toPosix(file.pathname));
1787
- }
1788
- if (file.document) {
1789
- for (const { instance } of this.Document) {
1790
- if (instance.setLocalUri && this.hasDocument(instance, file.document)) {
1791
- instance.setLocalUri(file, replace);
1792
- }
1793
- }
1793
+ segments.push(file.pathname);
1794
1794
  }
1795
- const pathname = segments.length ? path.join(this.baseDirectory, ...segments) : this.baseDirectory;
1795
+ const pathname = segments.length > 0 ? path.join(this.baseDirectory, ...segments) : this.baseDirectory;
1796
1796
  const localUri = file.filename ? path.join(pathname, file.filename) : pathname;
1797
1797
  file.localUri = localUri;
1798
- if (type !== 4) {
1799
- file.mimeType || (file.mimeType = file.url && core_1.Host.lookupMime(path.basename(file.url.pathname)) || core_1.Host.lookupMime(file.filename));
1798
+ if (!file.mimeType && type !== 4) {
1799
+ file.mimeType = file.url && core_1.Host.lookupMime(path.basename(file.url.pathname)) || core_1.Host.lookupMime(file.filename);
1800
1800
  }
1801
1801
  return { pathname, localUri };
1802
1802
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
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.9.5",
24
- "@e-mc/compress": "0.9.5",
25
- "@e-mc/core": "0.9.5",
26
- "@e-mc/document": "0.9.5",
27
- "@e-mc/image": "0.9.5",
28
- "@e-mc/request": "0.9.5",
29
- "@e-mc/task": "0.9.5",
30
- "@e-mc/types": "0.9.5",
31
- "@e-mc/watch": "0.9.5",
23
+ "@e-mc/cloud": "0.9.6",
24
+ "@e-mc/compress": "0.9.6",
25
+ "@e-mc/core": "0.9.6",
26
+ "@e-mc/document": "0.9.6",
27
+ "@e-mc/image": "0.9.6",
28
+ "@e-mc/request": "0.9.6",
29
+ "@e-mc/task": "0.9.6",
30
+ "@e-mc/types": "0.9.6",
31
+ "@e-mc/watch": "0.9.6",
32
32
  "chalk": "4.1.2",
33
33
  "picomatch": "^4.0.2"
34
34
  }