@e-mc/file-manager 0.7.7 → 0.7.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 +0 -2
  2. package/index.js +20 -20
  3. package/package.json +10 -10
package/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # @e-mc/file-manager
2
2
 
3
- PEP 402 - Forever Any Tomato
4
-
5
3
  ## LICENSE
6
4
 
7
5
  MIT
package/index.js CHANGED
@@ -1548,25 +1548,8 @@ class FileManager extends core_1.Host {
1548
1548
  if (state === 0 && (this.cleared && this[kDelayed] <= 0 || override) || (this.aborted || state === 3) && override) {
1549
1549
  this.clearProcessTimeout();
1550
1550
  this[kDelayed] = Infinity;
1551
- const resetState = () => {
1552
- this.finalizeState = 2;
1553
- this._pendingResult = null;
1554
- };
1555
- const aborted = (err) => {
1556
- if (!this.restarting) {
1557
- this.writeFail(["Transaction was not completed", this.baseDirectory], err);
1558
- resetState();
1559
- }
1560
- else {
1561
- this.finalizeState = 4;
1562
- }
1563
- this.emit('end', [], collectErrors.call(this), this.collectLog());
1564
- if (!this.restarting) {
1565
- this.done = true;
1566
- }
1567
- };
1568
1551
  if (this.aborted) {
1569
- aborted((0, types_1.createAbortError)());
1552
+ this.abortFinalize((0, types_1.createAbortError)());
1570
1553
  return;
1571
1554
  }
1572
1555
  this.finalizeState = 1;
@@ -1586,7 +1569,7 @@ class FileManager extends core_1.Host {
1586
1569
  if (LOG_TIMEELAPSED) {
1587
1570
  this.writeTimeElapsed('END', this.baseDirectory, this.startTime, errors.length > 0 ? { failed: true, ...core_1.Host.LOG_STYLE_FAIL } : { ...core_1.Host.LOG_STYLE_SUCCESS });
1588
1571
  }
1589
- resetState();
1572
+ this.resetState();
1590
1573
  const log = this.config.log;
1591
1574
  let useNumeric = false, showSize = true;
1592
1575
  if ((0, types_1.isPlainObject)(log)) {
@@ -1599,7 +1582,7 @@ class FileManager extends core_1.Host {
1599
1582
  this.emit('end', items, errors, this.collectLog());
1600
1583
  this.done = true;
1601
1584
  })
1602
- .catch(err => aborted(err));
1585
+ .catch(err => this.abortFinalize(err));
1603
1586
  }
1604
1587
  }
1605
1588
  hasDocument(instance, document) {
@@ -3543,6 +3526,23 @@ class FileManager extends core_1.Host {
3543
3526
  close() {
3544
3527
  this.Request.close();
3545
3528
  }
3529
+ resetState() {
3530
+ this.finalizeState = 2;
3531
+ this._pendingResult = null;
3532
+ }
3533
+ abortFinalize(err) {
3534
+ if (!this.restarting) {
3535
+ this.writeFail(["Transaction was not completed", this.baseDirectory], err);
3536
+ this.resetState();
3537
+ }
3538
+ else {
3539
+ this.finalizeState = 4;
3540
+ }
3541
+ this.emit('end', [], collectErrors.call(this), this.collectLog());
3542
+ if (!this.restarting) {
3543
+ this.done = true;
3544
+ }
3545
+ }
3546
3546
  set restarting(value) {
3547
3547
  this.finalizeState = (this[kRestarting] = value) ? 3 : 0;
3548
3548
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
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.7.7",
24
- "@e-mc/compress": "0.7.7",
25
- "@e-mc/core": "0.7.7",
26
- "@e-mc/document": "0.7.7",
27
- "@e-mc/image": "0.7.7",
28
- "@e-mc/request": "0.7.7",
29
- "@e-mc/task": "0.7.7",
30
- "@e-mc/types": "0.7.7",
31
- "@e-mc/watch": "0.7.7",
23
+ "@e-mc/cloud": "0.7.8",
24
+ "@e-mc/compress": "0.7.8",
25
+ "@e-mc/core": "0.7.8",
26
+ "@e-mc/document": "0.7.8",
27
+ "@e-mc/image": "0.7.8",
28
+ "@e-mc/request": "0.7.8",
29
+ "@e-mc/task": "0.7.8",
30
+ "@e-mc/types": "0.7.8",
31
+ "@e-mc/watch": "0.7.8",
32
32
  "picomatch": "^3.0.1"
33
33
  }
34
34
  }