@indra.ai/deva 1.1.69 → 1.1.70

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 (2) hide show
  1. package/index.js +4 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -952,7 +952,7 @@ class Deva {
952
952
  packet.q.meta.hash = this.hash(packet.q, 'sha256');
953
953
 
954
954
  this.action(_action);
955
- this.talk('devacore:question', packet); // global question event make sure to copy data.
955
+ this.talk('devacore:question', this.copy(packet)); // global question event make sure to copy data.
956
956
 
957
957
  if (isAsk) { // isAsk check if the question isAsk and talk
958
958
  this.state('ask');
@@ -1031,9 +1031,9 @@ class Deva {
1031
1031
 
1032
1032
 
1033
1033
  this.action('answer_talk');
1034
- this.talk('devacore:answer', packet); // talk the answer with a copy of the data
1034
+ this.talk('devacore:answer', this.copy(packet)); // talk the answer with a copy of the data
1035
1035
 
1036
- return resolve(packet); // resolve the packet to the caller.
1036
+ return resolve(this.copy(packet)); // resolve the packet to the caller.
1037
1037
  }).catch(err => { // catch any errors in the method
1038
1038
  this.action('error');
1039
1039
  return this.error(err, packet, reject); // return this.error with err, packet, reject
@@ -1967,7 +1967,7 @@ class Deva {
1967
1967
  data,
1968
1968
  created: Date.now(),
1969
1969
  }
1970
- this.talk('devacore:error', _data);
1970
+ this.talk('devacore:error', this.copy(_data));
1971
1971
 
1972
1972
  const hasOnError = this.onError && typeof this.onError === 'function' ? true : false;
1973
1973
  if (hasOnError) return this.onError(err, data, reject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.69",
3
+ "version": "1.1.70",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {