@juantroconisf/lib 2.2.3 → 2.2.4
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 +1 -4
- package/dist/index.mjs +1 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,7 +37,6 @@ var NextUIError = class {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
// src/utils.ts
|
|
40
|
-
var getNestedValueByKey = (obj, nestedKey) => nestedKey.split(".").reduce((acc, key) => acc[key], obj);
|
|
41
40
|
function handleNestedChange({
|
|
42
41
|
state,
|
|
43
42
|
id,
|
|
@@ -183,9 +182,7 @@ function useFormChange(initialObj) {
|
|
|
183
182
|
setState(initialObj);
|
|
184
183
|
};
|
|
185
184
|
function register(id, validations, errorMessages) {
|
|
186
|
-
const [value, isTouched] = [state, touched]
|
|
187
|
-
(obj) => getNestedValueByKey(obj, id)
|
|
188
|
-
), hasValidations = validations !== void 0, inputValidations = hasValidations ? getValidation(value, isTouched, validations, errorMessages) : {};
|
|
185
|
+
const [value, isTouched] = [state[id], touched[id]], hasValidations = validations !== void 0, inputValidations = hasValidations ? getValidation(value, isTouched, validations, errorMessages) : {};
|
|
189
186
|
errors2 = handleNestedChange({
|
|
190
187
|
state: errors2,
|
|
191
188
|
id,
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,6 @@ var NextUIError = class {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// src/utils.ts
|
|
22
|
-
var getNestedValueByKey = (obj, nestedKey) => nestedKey.split(".").reduce((acc, key) => acc[key], obj);
|
|
23
22
|
function handleNestedChange({
|
|
24
23
|
state,
|
|
25
24
|
id,
|
|
@@ -165,9 +164,7 @@ function useFormChange(initialObj) {
|
|
|
165
164
|
setState(initialObj);
|
|
166
165
|
};
|
|
167
166
|
function register(id, validations, errorMessages) {
|
|
168
|
-
const [value, isTouched] = [state, touched]
|
|
169
|
-
(obj) => getNestedValueByKey(obj, id)
|
|
170
|
-
), hasValidations = validations !== void 0, inputValidations = hasValidations ? getValidation(value, isTouched, validations, errorMessages) : {};
|
|
167
|
+
const [value, isTouched] = [state[id], touched[id]], hasValidations = validations !== void 0, inputValidations = hasValidations ? getValidation(value, isTouched, validations, errorMessages) : {};
|
|
171
168
|
errors2 = handleNestedChange({
|
|
172
169
|
state: errors2,
|
|
173
170
|
id,
|