@indra.ai/deva 1.1.107 → 1.1.108

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/config.json +0 -1
  2. package/index.js +3 -4
  3. package/package.json +1 -1
package/config.json CHANGED
@@ -41,7 +41,6 @@
41
41
  "load": "loading",
42
42
  "unload": "unloading",
43
43
  "done": "done state",
44
- "finish": "finish state",
45
44
  "invalid": "invalid state",
46
45
  "error": "error state",
47
46
  "help": "help state"
package/index.js CHANGED
@@ -1013,7 +1013,7 @@ class Deva {
1013
1013
  data.hash = this.hash(data);
1014
1014
  this.action(data.value)
1015
1015
  const hasOnDone = this.onDone && typeof this.onDone === 'function' ? true : false;
1016
- return hasOnDone ? this.onDone(data) : this.finish(data);
1016
+ return hasOnDone ? this.onDone(data) : Promise.resolve(data);
1017
1017
  }
1018
1018
 
1019
1019
  /**************
@@ -1029,7 +1029,6 @@ class Deva {
1029
1029
  ***************/
1030
1030
  finish(packet, resolve) {
1031
1031
  if (!this._active) return Promise.resolve(this._messages.states.offline);
1032
- this.state('finish');
1033
1032
  this.action('finish');
1034
1033
  const hasOnFinish = this.onFinish && typeof this.onFinish === 'function' ? true : false;
1035
1034
  if (hasOnFinish) return this.onFinish(packet, resolve);
@@ -1548,7 +1547,7 @@ class Deva {
1548
1547
  delete this.devas[key];
1549
1548
  this.talk(config.events.unload, key);
1550
1549
  });
1551
- return this.finish(this._messages.states.unload, resolve);
1550
+ return resolve(this._messages.states.unload);
1552
1551
  } catch (e) {
1553
1552
  return this.error(e, this.devas[key], reject)
1554
1553
  }
@@ -1862,7 +1861,7 @@ class Deva {
1862
1861
  if (params[1]) helpFile = `${params[0]}_${params[1]}`;
1863
1862
  helpFile = path.join(help_dir, 'help', `${helpFile}.feecting`);
1864
1863
  try {
1865
- return this.finish(fs.readFileSync(helpFile, 'utf8'), resolve)
1864
+ return resolve(fs.readFileSync(helpFile, 'utf8'));
1866
1865
  } catch (e) {
1867
1866
  this.action('help');
1868
1867
  this.zone('help');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.107",
3
+ "version": "1.1.108",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {