maraj 1.1.0 → 1.1.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/maraj.js +2 -2
- package/package.json +1 -1
package/maraj.js
CHANGED
|
@@ -71,14 +71,14 @@ export const remove = (keys) => (value) => {
|
|
|
71
71
|
/**
|
|
72
72
|
* Creates a selector with a string path
|
|
73
73
|
* @param {string} path - path, ex: 'login.form.username.value'
|
|
74
|
-
* @returns - store selector
|
|
74
|
+
* @returns - store selector || undefined
|
|
75
75
|
*/
|
|
76
76
|
export const createSelectorFromStringPath = (path) => (state) => {
|
|
77
77
|
if (typeof path !== 'string') throw new Error('Path should be string')
|
|
78
78
|
if (!path) return state
|
|
79
79
|
return path.split(".").reduce((current, key) => {
|
|
80
80
|
if (current?.hasOwnProperty(key)) return current[key]
|
|
81
|
-
|
|
81
|
+
return undefined
|
|
82
82
|
}, state)
|
|
83
83
|
}
|
|
84
84
|
|