@standard-community/standard-json 0.3.2 → 0.3.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.
@@ -8,17 +8,15 @@ async function getToJsonSchemaFn() {
8
8
  let handler;
9
9
  if ("_zod" in schema) {
10
10
  try {
11
- handler = await import('zod/v4/core').catch(() => {
12
- throw zodv4Error;
13
- }).then((mod) => mod.toJSONSchema);
11
+ const mod = await import('zod/v4/core');
12
+ handler = mod.toJSONSchema;
14
13
  } catch {
15
14
  throw zodv4Error;
16
15
  }
17
16
  } else {
18
17
  try {
19
- handler = await import('zod-to-json-schema').then(
20
- (mod) => mod.zodToJsonSchema
21
- );
18
+ const mod = await import('zod-to-json-schema');
19
+ handler = mod.zodToJsonSchema;
22
20
  } catch {
23
21
  throw new utils.MissingDependencyError("zod-to-json-schema");
24
22
  }
@@ -6,17 +6,15 @@ async function getToJsonSchemaFn() {
6
6
  let handler;
7
7
  if ("_zod" in schema) {
8
8
  try {
9
- handler = await import('zod/v4/core').catch(() => {
10
- throw zodv4Error;
11
- }).then((mod) => mod.toJSONSchema);
9
+ const mod = await import('zod/v4/core');
10
+ handler = mod.toJSONSchema;
12
11
  } catch {
13
12
  throw zodv4Error;
14
13
  }
15
14
  } else {
16
15
  try {
17
- handler = await import('zod-to-json-schema').then(
18
- (mod) => mod.zodToJsonSchema
19
- );
16
+ const mod = await import('zod-to-json-schema');
17
+ handler = mod.zodToJsonSchema;
20
18
  } catch {
21
19
  throw new MissingDependencyError("zod-to-json-schema");
22
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-json",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",