@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 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
- console.log([...formData.entries()].map((e) => [e[0], e[1]]));
790
- console.log(jsonSchemaParsed);
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
- console.log(obj2);
827
- console.log("fileEntries", parsed1.fileEntries);
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,
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "default": "./dist/index.js"
9
9
  }
10
10
  },
11
- "version": "1.0.0-alpha.20",
11
+ "version": "1.0.0-alpha.21",
12
12
  "publishConfig": {
13
13
  "access": "restricted"
14
14
  },