@cocreate/utils 1.15.0 → 1.15.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.15.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.15.0...v1.15.1) (2022-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * getValueFromObject returned false if value could not be found, it will now return undefined ([2ca7c4f](https://github.com/CoCreate-app/CoCreate-utils/commit/2ca7c4f1c893025b9240b796858457a1b33cc47e))
7
+
1
8
  # [1.15.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.3...v1.15.0) (2022-12-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "utils",
@@ -61,6 +61,6 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/docs": "^1.4.13"
64
+ "@cocreate/docs": "^1.4.15"
65
65
  }
66
66
  }
package/src/utils.js CHANGED
@@ -85,7 +85,7 @@
85
85
  function getValueFromObject(json, path) {
86
86
  try {
87
87
  if (typeof json == 'undefined' || !path)
88
- return false;
88
+ return;
89
89
 
90
90
  if (/\[([0-9]*)\]/g.test(path)) {
91
91
  path = path.replace(/\[/g, '.');
@@ -98,12 +98,12 @@
98
98
 
99
99
  for (let i = 0; i < subpath.length; i++) {
100
100
  jsonData = jsonData[subpath[i]];
101
- if (!jsonData) return false;
101
+ if (!jsonData) return;
102
102
  }
103
103
  return jsonData;
104
104
  }catch(error){
105
105
  console.log("Error in getValueFromObject", error);
106
- return false;
106
+ return;
107
107
  }
108
108
  }
109
109