@ejfdelgado/ejflab-common 1.7.3 → 1.7.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-common",
3
3
  "type": "commonjs",
4
- "version": "1.7.3",
4
+ "version": "1.7.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ejfdelgado/ejflab-common.git"
@@ -13,8 +13,13 @@ class CommandPostgres extends CommandBasic {
13
13
  if (action == "execute") {
14
14
  //console.log("Starting execute...");
15
15
  const dbIdData = SimpleObj.getValue(this.context.data, dbIdPath, null);
16
- let bodyData = SimpleObj.getValue(this.context.data, bodyPath, null);
17
- bodyData = JSON.parse(JSON.stringify(bodyData));
16
+ let bodyData = {};
17
+ if (typeof bodyPath == "string") {
18
+ bodyData = SimpleObj.getValue(this.context.data, bodyPath, {});
19
+ bodyData = JSON.parse(JSON.stringify(bodyData));
20
+ } else if (typeof bodyPath == "object" && bodyPath !== null) {
21
+ bodyData = bodyPath;
22
+ }
18
23
  if (!(bodyData instanceof Array)) {
19
24
  bodyData = [bodyData]
20
25
  }