@maestro-js/form 1.0.0-alpha.20 → 1.0.0-alpha.21
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 -0
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -112,6 +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
|
+
skipLogging?: boolean;
|
|
115
116
|
}
|
|
116
117
|
declare function parseFormDataClientSide<T>(schema: StandardSchema<T>, formData: FormData, options?: ParseFormDataOptions<T>): ParseFormDataResult<T> & {
|
|
117
118
|
fileEntries: FoundFile[];
|
package/dist/index.js
CHANGED
|
@@ -786,8 +786,10 @@ function parseFormDataClientSide(schema, formData, options) {
|
|
|
786
786
|
throw new Error("Async validation not supported");
|
|
787
787
|
}
|
|
788
788
|
if (safeParsed.issues?.length) {
|
|
789
|
-
|
|
790
|
-
|
|
789
|
+
if (!options?.skipLogging) {
|
|
790
|
+
console.log([...formData.entries()].map((e) => [e[0], e[1]]));
|
|
791
|
+
console.log(jsonSchemaParsed);
|
|
792
|
+
}
|
|
791
793
|
return {
|
|
792
794
|
issues: [...safeParsed.issues.map((i) => ({ ...i, path: i.path ? [...i.path] : i.path }))],
|
|
793
795
|
data: jsonSchemaParsed,
|
|
@@ -823,8 +825,10 @@ async function parseFormData(schema, formData, options) {
|
|
|
823
825
|
if (!safeParsed2.issues?.length) {
|
|
824
826
|
return { data: obj2, issues: void 0, formData, formId, success: true };
|
|
825
827
|
} else {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
+
if (!options?.skipLogging) {
|
|
829
|
+
console.log(obj2);
|
|
830
|
+
console.log("fileEntries", parsed1.fileEntries);
|
|
831
|
+
}
|
|
828
832
|
return {
|
|
829
833
|
issues: [...safeParsed2.issues.map((i) => ({ ...i, path: i.path ? [...i.path] : i.path }))],
|
|
830
834
|
data: obj2,
|