@cocreate/utils 1.15.0 → 1.15.2
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 +14 -0
- package/package.json +2 -2
- package/src/utils.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.15.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.15.1...v1.15.2) (2022-12-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies ([97c1d5f](https://github.com/CoCreate-app/CoCreate-utils/commit/97c1d5fc7d514989169a314d503f6e08dd77078c))
|
|
7
|
+
|
|
8
|
+
## [1.15.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.15.0...v1.15.1) (2022-12-09)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* getValueFromObject returned false if value could not be found, it will now return undefined ([2ca7c4f](https://github.com/CoCreate-app/CoCreate-utils/commit/2ca7c4f1c893025b9240b796858457a1b33cc47e))
|
|
14
|
+
|
|
1
15
|
# [1.15.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.14.3...v1.15.0) (2022-12-08)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/utils",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
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.
|
|
64
|
+
"@cocreate/docs": "^1.4.16"
|
|
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
|
|
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
|
|
101
|
+
if (!jsonData) return;
|
|
102
102
|
}
|
|
103
103
|
return jsonData;
|
|
104
104
|
}catch(error){
|
|
105
105
|
console.log("Error in getValueFromObject", error);
|
|
106
|
-
return
|
|
106
|
+
return;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|