@indra.ai/deva 1.1.62 → 1.1.64
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.
- package/index.js +10 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1843,13 +1843,18 @@ class Deva {
|
|
|
1843
1843
|
for copying.
|
|
1844
1844
|
***************/
|
|
1845
1845
|
copy(obj) {
|
|
1846
|
-
let v, key;
|
|
1847
1846
|
const output = Array.isArray(obj) ? [] : {};
|
|
1848
|
-
|
|
1849
|
-
v
|
|
1850
|
-
|
|
1847
|
+
try {
|
|
1848
|
+
let v, key;
|
|
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
|
/**************
|