maraj 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/maraj.js +3 -2
  2. package/package.json +1 -1
package/maraj.js CHANGED
@@ -71,14 +71,15 @@ 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
- throw new Error(`Key "${key}" doesnt exist in "${path}"`)
81
+ console.log('current', current)
82
+ return undefined
82
83
  }, state)
83
84
  }
84
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maraj",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A lightweight 500 bytes gzipped alternative for immutable updates while dealing with objects and arrays",
5
5
  "main": "maraj.js",
6
6
  "type": "module",