@e-mc/file-manager 0.9.5 → 0.9.7
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.
- package/README.md +10 -10
- package/index.js +11 -11
- 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.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.7/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.
|
|
290
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
291
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
292
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
293
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
294
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
295
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
296
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
297
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
289
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/squared.d.ts
|
|
290
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/asset.d.ts
|
|
291
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/core.d.ts
|
|
292
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/filemanager.d.ts
|
|
293
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/logger.d.ts
|
|
294
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/module.d.ts
|
|
295
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/node.d.ts
|
|
296
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/lib/request.d.ts
|
|
297
|
+
- https://www.unpkg.com/@e-mc/types@0.9.7/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
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.9.7",
|
|
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.
|
|
24
|
-
"@e-mc/compress": "0.9.
|
|
25
|
-
"@e-mc/core": "0.9.
|
|
26
|
-
"@e-mc/document": "0.9.
|
|
27
|
-
"@e-mc/image": "0.9.
|
|
28
|
-
"@e-mc/request": "0.9.
|
|
29
|
-
"@e-mc/task": "0.9.
|
|
30
|
-
"@e-mc/types": "0.9.
|
|
31
|
-
"@e-mc/watch": "0.9.
|
|
23
|
+
"@e-mc/cloud": "0.9.7",
|
|
24
|
+
"@e-mc/compress": "0.9.7",
|
|
25
|
+
"@e-mc/core": "0.9.7",
|
|
26
|
+
"@e-mc/document": "0.9.7",
|
|
27
|
+
"@e-mc/image": "0.9.7",
|
|
28
|
+
"@e-mc/request": "0.9.7",
|
|
29
|
+
"@e-mc/task": "0.9.7",
|
|
30
|
+
"@e-mc/types": "0.9.7",
|
|
31
|
+
"@e-mc/watch": "0.9.7",
|
|
32
32
|
"chalk": "4.1.2",
|
|
33
33
|
"picomatch": "^4.0.2"
|
|
34
34
|
}
|