@maestro-js/form 1.0.0-alpha.22 → 1.0.0-alpha.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.d.ts +0 -1
- package/dist/index.js +7 -11
- package/package.json +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -112,7 +112,6 @@ 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
|
-
debugLogOnFailure?: boolean;
|
|
116
115
|
}
|
|
117
116
|
declare function parseFormDataClientSide<T>(schema: StandardSchema<T>, formData: FormData, options?: ParseFormDataOptions<T>): ParseFormDataResult<T> & {
|
|
118
117
|
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 "lodash.set";
|
|
653
653
|
|
|
654
654
|
// src/json-schema-helpers.ts
|
|
655
|
-
import
|
|
656
|
-
import
|
|
655
|
+
import set from "lodash.set";
|
|
656
|
+
import get from "lodash.get";
|
|
657
657
|
function parseJsonSchemaFormData(schema, formData) {
|
|
658
658
|
const flat = flattenJsonSchema(schema);
|
|
659
659
|
const booleans = flat.filter((f) => resolvedType(f.schema) === "boolean");
|
|
@@ -786,10 +786,8 @@ function parseFormDataClientSide(schema, formData, options) {
|
|
|
786
786
|
throw new Error("Async validation not supported");
|
|
787
787
|
}
|
|
788
788
|
if (safeParsed.issues?.length) {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
console.log(jsonSchemaParsed);
|
|
792
|
-
}
|
|
789
|
+
console.log([...formData.entries()].map((e) => [e[0], e[1]]));
|
|
790
|
+
console.log(jsonSchemaParsed);
|
|
793
791
|
return {
|
|
794
792
|
issues: [...safeParsed.issues.map((i) => ({ ...i, path: i.path ? [...i.path] : i.path }))],
|
|
795
793
|
data: jsonSchemaParsed,
|
|
@@ -825,10 +823,8 @@ async function parseFormData(schema, formData, options) {
|
|
|
825
823
|
if (!safeParsed2.issues?.length) {
|
|
826
824
|
return { data: obj2, issues: void 0, formData, formId, success: true };
|
|
827
825
|
} else {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
console.log("fileEntries", parsed1.fileEntries);
|
|
831
|
-
}
|
|
826
|
+
console.log(obj2);
|
|
827
|
+
console.log("fileEntries", parsed1.fileEntries);
|
|
832
828
|
return {
|
|
833
829
|
issues: [...safeParsed2.issues.map((i) => ({ ...i, path: i.path ? [...i.path] : i.path }))],
|
|
834
830
|
data: obj2,
|
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.3",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "restricted"
|
|
14
14
|
},
|
|
@@ -24,10 +24,13 @@
|
|
|
24
24
|
"react": ">=19"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"lodash.get": "^4.4.2",
|
|
28
|
+
"lodash.set": "^4.3.2",
|
|
29
|
+
"@standard-schema/spec": "^1.1.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
32
|
+
"@types/lodash.get": "^4.4.9",
|
|
33
|
+
"@types/lodash.set": "^4.3.9",
|
|
31
34
|
"@types/node": "^22.0.0",
|
|
32
35
|
"@types/react": "^19.0.0",
|
|
33
36
|
"tsx": "^4.21.0",
|