@maestro-js/form 1.0.0-alpha.21 → 1.0.0-alpha.22
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.d.ts +1 -1
- package/dist/index.js +5 -5
- package/package.json +3 -6
package/dist/index.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ interface ParseFormDataOptions<T> {
|
|
|
112
112
|
handleFile?(file: File, path: string, data: T): Promise<string>;
|
|
113
113
|
validateLibraryOptions?: Record<string, unknown> | undefined;
|
|
114
114
|
jsonSchemaLibraryOptions?: Record<string, unknown> | undefined;
|
|
115
|
-
|
|
115
|
+
debugLogOnFailure?: boolean;
|
|
116
116
|
}
|
|
117
117
|
declare function parseFormDataClientSide<T>(schema: StandardSchema<T>, formData: FormData, options?: ParseFormDataOptions<T>): ParseFormDataResult<T> & {
|
|
118
118
|
fileEntries: FoundFile[];
|
package/dist/index.js
CHANGED
|
@@ -649,11 +649,11 @@ function isEqualValidation2(a, b) {
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
// src/standard-schema-helpers.ts
|
|
652
|
-
import set2 from "
|
|
652
|
+
import set2 from "es-toolkit/compat/set";
|
|
653
653
|
|
|
654
654
|
// src/json-schema-helpers.ts
|
|
655
|
-
import
|
|
656
|
-
import
|
|
655
|
+
import get from "es-toolkit/compat/get";
|
|
656
|
+
import set from "es-toolkit/compat/set";
|
|
657
657
|
function parseJsonSchemaFormData(schema, formData) {
|
|
658
658
|
const flat = flattenJsonSchema(schema);
|
|
659
659
|
const booleans = flat.filter((f) => resolvedType(f.schema) === "boolean");
|
|
@@ -786,7 +786,7 @@ function parseFormDataClientSide(schema, formData, options) {
|
|
|
786
786
|
throw new Error("Async validation not supported");
|
|
787
787
|
}
|
|
788
788
|
if (safeParsed.issues?.length) {
|
|
789
|
-
if (
|
|
789
|
+
if (options?.debugLogOnFailure) {
|
|
790
790
|
console.log([...formData.entries()].map((e) => [e[0], e[1]]));
|
|
791
791
|
console.log(jsonSchemaParsed);
|
|
792
792
|
}
|
|
@@ -825,7 +825,7 @@ async function parseFormData(schema, formData, options) {
|
|
|
825
825
|
if (!safeParsed2.issues?.length) {
|
|
826
826
|
return { data: obj2, issues: void 0, formData, formId, success: true };
|
|
827
827
|
} else {
|
|
828
|
-
if (
|
|
828
|
+
if (options?.debugLogOnFailure) {
|
|
829
829
|
console.log(obj2);
|
|
830
830
|
console.log("fileEntries", parsed1.fileEntries);
|
|
831
831
|
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"version": "1.0.0-alpha.
|
|
11
|
+
"version": "1.0.0-alpha.22",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "restricted"
|
|
14
14
|
},
|
|
@@ -24,13 +24,10 @@
|
|
|
24
24
|
"react": ">=19"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"@standard-schema/spec": "^1.1.0"
|
|
27
|
+
"@standard-schema/spec": "^1.1.0",
|
|
28
|
+
"es-toolkit": "^1.46.1"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@types/lodash.get": "^4.4.9",
|
|
33
|
-
"@types/lodash.set": "^4.3.9",
|
|
34
31
|
"@types/node": "^22.0.0",
|
|
35
32
|
"@types/react": "^19.0.0",
|
|
36
33
|
"tsx": "^4.21.0",
|