@indra.ai/deva 1.1.61 → 1.1.63

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 +12 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1026,7 +1026,7 @@ class Deva {
1026
1026
  // create a hash for the answer and insert into answer meta.
1027
1027
  packet_answer.meta.hash = this.hash(packet_answer, 'sha256');
1028
1028
 
1029
- packet.a = this.copy(packet_answer);
1029
+ packet.a = packet_answer;
1030
1030
  packet.hash = this.hash(packet, 'sha256'); // hash the entire packet.
1031
1031
 
1032
1032
 
@@ -1843,13 +1843,18 @@ class Deva {
1843
1843
  for copying.
1844
1844
  ***************/
1845
1845
  copy(obj) {
1846
- let v, key;
1847
- const output = Array.isArray(obj) ? [] : {};
1848
- for (key in obj) {
1849
- v = obj[key];
1850
- output[key] = (typeof v === "object") ? this.copy(v) : v;
1846
+ try {
1847
+ let v, key;
1848
+ const output = Array.isArray(obj) ? [] : {};
1849
+ for (key in obj) {
1850
+ v = obj[key];
1851
+ output[key] = (typeof v === "object") ? this.copy(v) : v;
1852
+ }
1853
+ } catch (e) {
1854
+ return this.error(e, obj)
1855
+ } finally {
1856
+ return output;
1851
1857
  }
1852
- return output;
1853
1858
  }
1854
1859
 
1855
1860
  /**************
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {