@juantroconisf/lib 2.2.2 → 2.2.3

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/dist/index.js CHANGED
@@ -41,8 +41,10 @@ var getNestedValueByKey = (obj, nestedKey) => nestedKey.split(".").reduce((acc,
41
41
  function handleNestedChange({
42
42
  state,
43
43
  id,
44
- value
44
+ value,
45
+ hasNestedValues = false
45
46
  }) {
47
+ if (!hasNestedValues) return { ...state, [id]: value };
46
48
  const propertyDepth = id.split("."), newValues = state;
47
49
  let current = newValues;
48
50
  for (let i = 0; i < propertyDepth.length - 1; i++) {
package/dist/index.mjs CHANGED
@@ -23,8 +23,10 @@ var getNestedValueByKey = (obj, nestedKey) => nestedKey.split(".").reduce((acc,
23
23
  function handleNestedChange({
24
24
  state,
25
25
  id,
26
- value
26
+ value,
27
+ hasNestedValues = false
27
28
  }) {
29
+ if (!hasNestedValues) return { ...state, [id]: value };
28
30
  const propertyDepth = id.split("."), newValues = state;
29
31
  let current = newValues;
30
32
  for (let i = 0; i < propertyDepth.length - 1; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juantroconisf/lib",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",