@mixd-id/web-scaffold 0.1.230406025 → 0.1.230406027
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 +1 -1
- package/src/utils/helpers.mjs +3 -1
package/package.json
CHANGED
package/src/utils/helpers.mjs
CHANGED
|
@@ -126,11 +126,13 @@ const uid = function(prefix){
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const accessNestedObject = function(obj, path) {
|
|
129
|
+
if(!obj || typeof path !== 'string') return undefined
|
|
130
|
+
|
|
129
131
|
const keys = path.split('.');
|
|
130
132
|
let nestedObj = obj;
|
|
131
133
|
|
|
132
134
|
for (let key of keys) {
|
|
133
|
-
if (nestedObj.hasOwnProperty(key)) {
|
|
135
|
+
if (nestedObj && nestedObj.hasOwnProperty(key)) {
|
|
134
136
|
nestedObj = nestedObj[key];
|
|
135
137
|
} else {
|
|
136
138
|
// Return undefined if any key in the path is missing
|