@e-mc/file-manager 0.8.3 → 0.8.5
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/LICENSE +4 -8
- package/README.md +4 -4
- package/index.js +6 -14
- package/package.json +11 -11
package/LICENSE
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2024 Mile Square Park
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
-
|
|
11
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -1364,7 +1364,7 @@ class FileManager extends core_1.Host {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
const isSame = (a, b) => a === b || decodeURIComponent(a) === decodeURIComponent(b);
|
|
1366
1366
|
const result = (assets || this.assets).filter(item => {
|
|
1367
|
-
|
|
1367
|
+
const { uri, flags } = item;
|
|
1368
1368
|
if (uri && (!instance || this.hasDocument(instance, item.document)) && (!item.invalid || assets || (0, types_1.mainFlag)(flags) || (0, types_1.usingFlag)(flags) || (0, types_1.cloneFlag)(flags) || (0, types_1.watchFlag)(flags))) {
|
|
1369
1369
|
if (origin) {
|
|
1370
1370
|
if (!item.url) {
|
|
@@ -1386,13 +1386,7 @@ class FileManager extends core_1.Host {
|
|
|
1386
1386
|
const indexA = uri.indexOf('#');
|
|
1387
1387
|
const indexB = value.indexOf('#');
|
|
1388
1388
|
if (indexA !== -1 || indexB !== -1) {
|
|
1389
|
-
|
|
1390
|
-
uri = uri.substring(0, indexA);
|
|
1391
|
-
}
|
|
1392
|
-
if (indexB !== -1) {
|
|
1393
|
-
value = value.substring(0, indexB);
|
|
1394
|
-
}
|
|
1395
|
-
return isSame(uri, value);
|
|
1389
|
+
return isSame(indexA !== -1 ? uri.substring(0, indexA) : uri, indexB !== -1 ? value.substring(0, indexB) : value);
|
|
1396
1390
|
}
|
|
1397
1391
|
}
|
|
1398
1392
|
return false;
|
|
@@ -2220,7 +2214,7 @@ class FileManager extends core_1.Host {
|
|
|
2220
2214
|
options = { format: options };
|
|
2221
2215
|
}
|
|
2222
2216
|
options.format || (options.format = 'json');
|
|
2223
|
-
return this.Request.get(uri, options).then(data => typeof data === 'object' ? data : null)
|
|
2217
|
+
return this.Request.get(uri, options).then(data => typeof data === 'object' ? data : null);
|
|
2224
2218
|
}
|
|
2225
2219
|
async fetchBuffer(uri, options) {
|
|
2226
2220
|
if (options && 'format' in options) {
|
|
@@ -3003,7 +2997,6 @@ class FileManager extends core_1.Host {
|
|
|
3003
2997
|
break;
|
|
3004
2998
|
}
|
|
3005
2999
|
const { pathname, localUri } = download;
|
|
3006
|
-
const uri = item.uri;
|
|
3007
3000
|
if (item.content) {
|
|
3008
3001
|
if (!checkQueue(item, localUri, pathname, true)) {
|
|
3009
3002
|
const content = item.content;
|
|
@@ -3033,6 +3026,7 @@ class FileManager extends core_1.Host {
|
|
|
3033
3026
|
}
|
|
3034
3027
|
continue;
|
|
3035
3028
|
}
|
|
3029
|
+
const uri = item.uri;
|
|
3036
3030
|
if (!uri) {
|
|
3037
3031
|
item.invalid = true;
|
|
3038
3032
|
continue;
|
|
@@ -3079,10 +3073,7 @@ class FileManager extends core_1.Host {
|
|
|
3079
3073
|
request.statusMessage = location + (bundleMain ? ' (0)' : '');
|
|
3080
3074
|
if (isHttp) {
|
|
3081
3075
|
request.method = 'GET';
|
|
3082
|
-
|
|
3083
|
-
if (count <= 1) {
|
|
3084
|
-
request.httpVersion = 1;
|
|
3085
|
-
}
|
|
3076
|
+
request.httpVersion = (originCount[request.url.origin] || 0) <= 1 ? 1 : undefined;
|
|
3086
3077
|
request.connected = headers => {
|
|
3087
3078
|
applyHeaders(item, headers, true, mainEtag);
|
|
3088
3079
|
return item.willChange || !!etagDir && (cacheDir || !item.contentLength || cacheToMemory.within(item.contentLength));
|
|
@@ -3090,6 +3081,7 @@ class FileManager extends core_1.Host {
|
|
|
3090
3081
|
}
|
|
3091
3082
|
else {
|
|
3092
3083
|
request.socketPath = item.socketPath;
|
|
3084
|
+
request.method = undefined;
|
|
3093
3085
|
request.httpVersion = 1;
|
|
3094
3086
|
}
|
|
3095
3087
|
this.fetchBuffer(request.url, request)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/file-manager",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "FileManager constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"squared-functions"
|
|
18
18
|
],
|
|
19
19
|
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "
|
|
20
|
+
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "0.8.
|
|
24
|
-
"@e-mc/compress": "0.8.
|
|
25
|
-
"@e-mc/core": "0.8.
|
|
26
|
-
"@e-mc/document": "0.8.
|
|
27
|
-
"@e-mc/image": "0.8.
|
|
28
|
-
"@e-mc/request": "0.8.
|
|
29
|
-
"@e-mc/task": "0.8.
|
|
30
|
-
"@e-mc/types": "0.8.
|
|
31
|
-
"@e-mc/watch": "0.8.
|
|
23
|
+
"@e-mc/cloud": "0.8.5",
|
|
24
|
+
"@e-mc/compress": "0.8.5",
|
|
25
|
+
"@e-mc/core": "0.8.5",
|
|
26
|
+
"@e-mc/document": "0.8.5",
|
|
27
|
+
"@e-mc/image": "0.8.5",
|
|
28
|
+
"@e-mc/request": "0.8.5",
|
|
29
|
+
"@e-mc/task": "0.8.5",
|
|
30
|
+
"@e-mc/types": "0.8.5",
|
|
31
|
+
"@e-mc/watch": "0.8.5",
|
|
32
32
|
"picomatch": "^3.0.1"
|
|
33
33
|
}
|
|
34
34
|
}
|