@standard-community/standard-json 0.3.2 → 0.3.4

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.cjs CHANGED
@@ -18,6 +18,9 @@ const getToJsonSchemaFn = async (vendor) => {
18
18
  case "effect":
19
19
  vendorFnPromise = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./vendors/effect.cjs')); })).default();
20
20
  break;
21
+ case "typebox":
22
+ vendorFnPromise = (await Promise.resolve().then(function () { return require('./typebox-DYb9QD5O.cjs'); })).default();
23
+ break;
21
24
  case "valibot":
22
25
  vendorFnPromise = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./vendors/valibot.cjs')); })).default();
23
26
  break;
package/dist/index.js CHANGED
@@ -14,6 +14,9 @@ const getToJsonSchemaFn = async (vendor) => {
14
14
  case "effect":
15
15
  vendorFnPromise = (await import('./vendors/effect.js')).default();
16
16
  break;
17
+ case "typebox":
18
+ vendorFnPromise = (await import('./typebox-Dei93FPO.js')).default();
19
+ break;
17
20
  case "valibot":
18
21
  vendorFnPromise = (await import('./vendors/valibot.js')).default();
19
22
  break;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ function getToJsonSchemaFn() {
4
+ return (schema) => JSON.parse(JSON.stringify(schema.Type()));
5
+ }
6
+
7
+ exports.default = getToJsonSchemaFn;
@@ -0,0 +1,5 @@
1
+ function getToJsonSchemaFn() {
2
+ return (schema) => JSON.parse(JSON.stringify(schema.Type()));
3
+ }
4
+
5
+ export { getToJsonSchemaFn as default };
@@ -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.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -85,6 +85,7 @@
85
85
  "@valibot/to-json-schema": "^1.3.0",
86
86
  "arktype": "^2.1.20",
87
87
  "effect": "^3.16.8",
88
+ "typebox": "^1.0.17",
88
89
  "quansync": "^0.2.11",
89
90
  "valibot": "^1.1.0",
90
91
  "zod": "^3.25.0 || ^4.0.0",
@@ -100,6 +101,9 @@
100
101
  "effect": {
101
102
  "optional": true
102
103
  },
104
+ "typebox": {
105
+ "optional": true
106
+ },
103
107
  "valibot": {
104
108
  "optional": true
105
109
  },