@maestro-js/form 1.0.0-alpha.20 → 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 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
+ debugLogOnFailure?: 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
@@ -649,11 +649,11 @@ function isEqualValidation2(a, b) {
649
649
  }
650
650
 
651
651
  // src/standard-schema-helpers.ts
652
- import set2 from "lodash.set";
652
+ import set2 from "es-toolkit/compat/set";
653
653
 
654
654
  // src/json-schema-helpers.ts
655
- import set from "lodash.set";
656
- import get from "lodash.get";
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,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?.debugLogOnFailure) {
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?.debugLogOnFailure) {
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.22",
12
12
  "publishConfig": {
13
13
  "access": "restricted"
14
14
  },
@@ -24,13 +24,10 @@
24
24
  "react": ">=19"
25
25
  },
26
26
  "dependencies": {
27
- "lodash.get": "^4.4.2",
28
- "lodash.set": "^4.3.2",
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",