@e-mc/file-manager 0.8.10 → 0.8.12

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 +20 -20
  3. package/package.json +10 -10
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -191,15 +191,15 @@ interface FileManagerConstructor extends HostConstructor {
191
191
 
192
192
  ## References
193
193
 
194
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/squared.d.ts
195
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/asset.d.ts
196
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/core.d.ts
197
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/filemanager.d.ts
198
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/logger.d.ts
199
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/module.d.ts
200
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/node.d.ts
201
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/request.d.ts
202
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/settings.d.ts
194
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/squared.d.ts
195
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/asset.d.ts
196
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/core.d.ts
197
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/filemanager.d.ts
198
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/logger.d.ts
199
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/module.d.ts
200
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/node.d.ts
201
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/request.d.ts
202
+ - https://www.unpkg.com/@e-mc/types@0.8.12/lib/settings.d.ts
203
203
 
204
204
  ## LICENSE
205
205
 
package/index.js CHANGED
@@ -1564,25 +1564,8 @@ class FileManager extends core_1.Host {
1564
1564
  if (state === 0 && (this.cleared && this[kDelayed] <= 0 || override) || (this.aborted || state === 3) && override) {
1565
1565
  this.clearProcessTimeout();
1566
1566
  this[kDelayed] = Infinity;
1567
- const resetState = () => {
1568
- this.finalizeState = 2;
1569
- this._pendingResult = null;
1570
- };
1571
- const aborted = (err) => {
1572
- if (!this.restarting) {
1573
- this.writeFail(["Transaction was not completed", this.baseDirectory], err);
1574
- resetState();
1575
- }
1576
- else {
1577
- this.finalizeState = 4;
1578
- }
1579
- this.emit('end', [], collectErrors.call(this), this.collectLog());
1580
- if (!this.restarting) {
1581
- this.done = true;
1582
- }
1583
- };
1584
1567
  if (this.aborted) {
1585
- aborted((0, types_1.createAbortError)());
1568
+ this.abortFinalize((0, types_1.createAbortError)());
1586
1569
  return;
1587
1570
  }
1588
1571
  this.finalizeState = 1;
@@ -1602,7 +1585,7 @@ class FileManager extends core_1.Host {
1602
1585
  if (LOG_TIMEELAPSED) {
1603
1586
  this.writeTimeElapsed('END', this.baseDirectory, this.startTime, errors.length > 0 ? { failed: true, ...core_1.Host.LOG_STYLE_FAIL } : { ...core_1.Host.LOG_STYLE_SUCCESS });
1604
1587
  }
1605
- resetState();
1588
+ this.resetState();
1606
1589
  const log = this.config.log;
1607
1590
  let useNumeric = false, showSize = true;
1608
1591
  if ((0, types_1.isPlainObject)(log)) {
@@ -1615,7 +1598,7 @@ class FileManager extends core_1.Host {
1615
1598
  this.emit('end', items, errors, this.collectLog());
1616
1599
  this.done = true;
1617
1600
  })
1618
- .catch(err => aborted(err));
1601
+ .catch(err => this.abortFinalize(err));
1619
1602
  }
1620
1603
  }
1621
1604
  hasDocument(instance, document) {
@@ -3588,6 +3571,23 @@ class FileManager extends core_1.Host {
3588
3571
  close() {
3589
3572
  this.Request.close();
3590
3573
  }
3574
+ resetState() {
3575
+ this.finalizeState = 2;
3576
+ this._pendingResult = null;
3577
+ }
3578
+ abortFinalize(err) {
3579
+ if (!this.restarting) {
3580
+ this.writeFail(["Transaction was not completed", this.baseDirectory], err);
3581
+ this.resetState();
3582
+ }
3583
+ else {
3584
+ this.finalizeState = 4;
3585
+ }
3586
+ this.emit('end', [], collectErrors.call(this), this.collectLog());
3587
+ if (!this.restarting) {
3588
+ this.done = true;
3589
+ }
3590
+ }
3591
3591
  set restarting(value) {
3592
3592
  this.finalizeState = (this[kRestarting] = value) ? 3 : 0;
3593
3593
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.8.10",
3
+ "version": "0.8.12",
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": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "0.8.10",
24
- "@e-mc/compress": "0.8.10",
25
- "@e-mc/core": "0.8.10",
26
- "@e-mc/document": "0.8.10",
27
- "@e-mc/image": "0.8.10",
28
- "@e-mc/request": "0.8.10",
29
- "@e-mc/task": "0.8.10",
30
- "@e-mc/types": "0.8.10",
31
- "@e-mc/watch": "0.8.10",
23
+ "@e-mc/cloud": "0.8.12",
24
+ "@e-mc/compress": "0.8.12",
25
+ "@e-mc/core": "0.8.12",
26
+ "@e-mc/document": "0.8.12",
27
+ "@e-mc/image": "0.8.12",
28
+ "@e-mc/request": "0.8.12",
29
+ "@e-mc/task": "0.8.12",
30
+ "@e-mc/types": "0.8.12",
31
+ "@e-mc/watch": "0.8.12",
32
32
  "picomatch": "^3.0.1"
33
33
  }
34
34
  }