@e-mc/file-manager 0.13.6 → 0.13.8

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 +11 -11
  2. package/index.js +16 -23
  3. package/package.json +11 -11
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @e-mc/file-manager
2
2
 
3
- * NodeJS 18.20.5 LTS
3
+ * NodeJS 18.20 LTS
4
4
  * ES2022
5
5
 
6
6
  ## General Usage
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.13.6/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.13.8/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { ChecksumValue, DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -297,15 +297,15 @@ NOTE: **FileManager** is a sub-class of [Host](https://www.npmjs.com/package/@e-
297
297
 
298
298
  ## References
299
299
 
300
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/squared.d.ts
301
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/asset.d.ts
302
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/core.d.ts
303
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/filemanager.d.ts
304
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/logger.d.ts
305
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/module.d.ts
306
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/node.d.ts
307
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/request.d.ts
308
- - https://www.unpkg.com/@e-mc/types@0.13.6/lib/settings.d.ts
300
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/squared.d.ts
301
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/asset.d.ts
302
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/core.d.ts
303
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/filemanager.d.ts
304
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/logger.d.ts
305
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/module.d.ts
306
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/node.d.ts
307
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/request.d.ts
308
+ - https://www.unpkg.com/@e-mc/types@0.13.8/lib/settings.d.ts
309
309
 
310
310
  * https://www.npmjs.com/package/@types/node
311
311
 
package/index.js CHANGED
@@ -1324,7 +1324,7 @@ class FileManager extends core_1.Host {
1324
1324
  if (typeof file_count === 'boolean') {
1325
1325
  MEMORY.FILE_COUNT = file_count;
1326
1326
  }
1327
- if ((0, types_1.isPlainObject)(request)) {
1327
+ if (request) {
1328
1328
  let { timeout, disk, buffer, connect } = request;
1329
1329
  if ((timeout = (0, util_2.fromSeconds)(timeout)) >= 0) {
1330
1330
  HTTP_CLIENT.timeout = timeout;
@@ -1920,15 +1920,15 @@ class FileManager extends core_1.Host {
1920
1920
  const database = this.dataSourceItems.filter(item => item.source === 'cloud');
1921
1921
  let instance;
1922
1922
  if ((0, types_1.isString)(target)) {
1923
- const module = args.shift();
1924
- if ((0, types_1.isObject)(module)) {
1923
+ const mod = args.shift();
1924
+ if ((0, types_1.isObject)(mod)) {
1925
1925
  if (target === "@e-mc/cloud") {
1926
- instance = new cloud_1(module, database);
1926
+ instance = new cloud_1(mod, database);
1927
1927
  }
1928
1928
  else {
1929
1929
  const Module = this.#tryPackage(target, name, 64);
1930
1930
  if (Module) {
1931
- instance = new Module(module, database);
1931
+ instance = new Module(mod, database);
1932
1932
  }
1933
1933
  }
1934
1934
  }
@@ -1947,15 +1947,15 @@ class FileManager extends core_1.Host {
1947
1947
  case 'watch': {
1948
1948
  let instance;
1949
1949
  if ((0, types_1.isString)(target)) {
1950
- const config = args.shift();
1951
- if ((0, types_1.isObject)(config)) {
1950
+ const mod = args.shift();
1951
+ if ((0, types_1.isObject)(mod)) {
1952
1952
  if (target === "@e-mc/watch") {
1953
- instance = new watch_1(config);
1953
+ instance = new watch_1(mod);
1954
1954
  }
1955
1955
  else {
1956
1956
  const Module = this.#tryPackage(target, name, 16);
1957
1957
  if (Module) {
1958
- instance = new Module(config);
1958
+ instance = new Module(mod);
1959
1959
  }
1960
1960
  }
1961
1961
  }
@@ -3133,16 +3133,9 @@ class FileManager extends core_1.Host {
3133
3133
  this.resetAssets();
3134
3134
  break;
3135
3135
  }
3136
- if (this.queued) {
3137
- const length = arguments.length;
3138
- const args = new Array(length);
3139
- for (let i = 0; i < length; ++i) {
3140
- args[i] = arguments[i];
3141
- }
3142
- if (this.joinQueue({ args })) {
3143
- this.finalizeState = 4;
3144
- return;
3145
- }
3136
+ if (this.queued && this.joinQueue({ args: Array.from(arguments) })) {
3137
+ this.finalizeState = 4;
3138
+ return;
3146
3139
  }
3147
3140
  if (targeted) {
3148
3141
  this.using(true, ...targeted);
@@ -3308,10 +3301,10 @@ class FileManager extends core_1.Host {
3308
3301
  item.flags |= 128;
3309
3302
  if (!etag || item.fetchType !== 1 || checksumOutput) {
3310
3303
  if (bundleIndex === 0 && !(0, types_1.isEmpty)(bundleId)) {
3311
- assets.filter(child => child.bundleId === bundleId && child.bundleIndex > 0).forEach(child => {
3312
- setBuffer(child);
3313
- child.invalid = true;
3314
- });
3304
+ for (const target of assets.filter(child => child.bundleId === bundleId && child.bundleIndex > 0)) {
3305
+ setBuffer(target);
3306
+ target.invalid = true;
3307
+ }
3315
3308
  }
3316
3309
  continue;
3317
3310
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "FileManager constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -19,17 +19,17 @@
19
19
  "license": "BSD-3-Clause",
20
20
  "homepage": "https://github.com/anpham6/e-mc#readme",
21
21
  "dependencies": {
22
- "@e-mc/cloud": "0.13.6",
23
- "@e-mc/compress": "0.13.6",
24
- "@e-mc/core": "0.13.6",
25
- "@e-mc/document": "0.13.6",
26
- "@e-mc/image": "0.13.6",
27
- "@e-mc/request": "0.13.6",
28
- "@e-mc/task": "0.13.6",
29
- "@e-mc/types": "0.13.6",
30
- "@e-mc/watch": "0.13.6",
22
+ "@e-mc/cloud": "0.13.8",
23
+ "@e-mc/compress": "0.13.8",
24
+ "@e-mc/core": "0.13.8",
25
+ "@e-mc/document": "0.13.8",
26
+ "@e-mc/image": "0.13.8",
27
+ "@e-mc/request": "0.13.8",
28
+ "@e-mc/task": "0.13.8",
29
+ "@e-mc/types": "0.13.8",
30
+ "@e-mc/watch": "0.13.8",
31
31
  "chalk": "4.1.2",
32
- "diff": "^8.0.2",
32
+ "diff": "^8.0.3",
33
33
  "picomatch": "^4.0.3"
34
34
  }
35
35
  }