@standard-community/standard-json 0.3.0-rc.2 → 0.3.0-rc.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.
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-BBK5urhS.js';
1
+ import { t as tryImport } from './index-BCoFb8WC.js';
2
2
 
3
3
  async function getToJsonSchemaFn() {
4
4
  const { JSONSchema } = await tryImport(import('effect'), "effect");
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DvrVjqKS.cjs');
3
+ var index = require('./index-Bx2xBXfI.cjs');
4
4
 
5
5
  async function getToJsonSchemaFn() {
6
6
  const { JSONSchema } = await index.tryImport(import('effect'), "effect");
@@ -12,11 +12,11 @@ const getToJsonSchemaFn = async (vendor) => {
12
12
  case "arktype":
13
13
  return (await import('./arktype-DUDu5yUt.js')).default();
14
14
  case "effect":
15
- return (await import('./effect-Bvx52kW3.js')).default();
15
+ return (await import('./effect-BHXCUs57.js')).default();
16
16
  case "valibot":
17
- return (await import('./valibot-dqIC-dYU.js')).default();
17
+ return (await import('./valibot-B3sSM057.js')).default();
18
18
  case "zod":
19
- return (await import('./zod-BXV2kwOE.js')).default();
19
+ return (await import('./zod-6IWvQABX.js')).default();
20
20
  default:
21
21
  throw new Error(
22
22
  errorMessageWrapper(`Unsupported schema vendor "${vendor}".`)
@@ -28,4 +28,4 @@ const toJsonSchema = (schema, options) => getToJsonSchemaFn(schema["~standard"].
28
28
  (toJsonSchema2) => toJsonSchema2(schema, options)
29
29
  );
30
30
 
31
- export { toJsonSchema as a, tryImport as t };
31
+ export { toJsonSchema as a, errorMessageWrapper as e, tryImport as t };
@@ -14,11 +14,11 @@ const getToJsonSchemaFn = async (vendor) => {
14
14
  case "arktype":
15
15
  return (await Promise.resolve().then(function () { return require('./arktype-BCitmcgd.cjs'); })).default();
16
16
  case "effect":
17
- return (await Promise.resolve().then(function () { return require('./effect-C8fjlj5o.cjs'); })).default();
17
+ return (await Promise.resolve().then(function () { return require('./effect-Btg6OWP3.cjs'); })).default();
18
18
  case "valibot":
19
- return (await Promise.resolve().then(function () { return require('./valibot-BUY58gEv.cjs'); })).default();
19
+ return (await Promise.resolve().then(function () { return require('./valibot-D9XXvyYJ.cjs'); })).default();
20
20
  case "zod":
21
- return (await Promise.resolve().then(function () { return require('./zod-DfeEqb6D.cjs'); })).default();
21
+ return (await Promise.resolve().then(function () { return require('./zod-P2Lea6ZA.cjs'); })).default();
22
22
  default:
23
23
  throw new Error(
24
24
  errorMessageWrapper(`Unsupported schema vendor "${vendor}".`)
@@ -30,5 +30,6 @@ const toJsonSchema = (schema, options) => getToJsonSchemaFn(schema["~standard"].
30
30
  (toJsonSchema2) => toJsonSchema2(schema, options)
31
31
  );
32
32
 
33
+ exports.errorMessageWrapper = errorMessageWrapper;
33
34
  exports.toJsonSchema = toJsonSchema;
34
35
  exports.tryImport = tryImport;
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DvrVjqKS.cjs');
3
+ var index = require('./index-Bx2xBXfI.cjs');
4
4
 
5
5
 
6
6
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { a as toJsonSchema } from './index-BBK5urhS.js';
1
+ export { a as toJsonSchema } from './index-BCoFb8WC.js';
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-BBK5urhS.js';
1
+ import { t as tryImport } from './index-BCoFb8WC.js';
2
2
 
3
3
  async function getToJsonSchemaFn() {
4
4
  const { toJsonSchema } = await tryImport(
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DvrVjqKS.cjs');
3
+ var index = require('./index-Bx2xBXfI.cjs');
4
4
 
5
5
  async function getToJsonSchemaFn() {
6
6
  const { toJsonSchema } = await index.tryImport(
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-BBK5urhS.js';
1
+ import { t as tryImport, e as errorMessageWrapper } from './index-BCoFb8WC.js';
2
2
 
3
3
  async function getToJsonSchemaFn() {
4
4
  return async (schema, options) => {
@@ -8,10 +8,11 @@ async function getToJsonSchemaFn() {
8
8
  (mod) => mod.toJSONSchema
9
9
  );
10
10
  } else {
11
- handler = await tryImport(
12
- import('zod-to-json-schema'),
13
- "zod-to-json-schema"
14
- ).then(
11
+ handler = await import('zod-to-json-schema').catch(() => {
12
+ throw new Error(
13
+ errorMessageWrapper('Missing dependencies "zod-to-json-schema".')
14
+ );
15
+ }).then(
15
16
  (mod) => mod.zodToJsonSchema
16
17
  );
17
18
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DvrVjqKS.cjs');
3
+ var index = require('./index-Bx2xBXfI.cjs');
4
4
 
5
5
  async function getToJsonSchemaFn() {
6
6
  return async (schema, options) => {
@@ -10,10 +10,11 @@ async function getToJsonSchemaFn() {
10
10
  (mod) => mod.toJSONSchema
11
11
  );
12
12
  } else {
13
- handler = await index.tryImport(
14
- import('zod-to-json-schema'),
15
- "zod-to-json-schema"
16
- ).then(
13
+ handler = await import('zod-to-json-schema').catch(() => {
14
+ throw new Error(
15
+ index.errorMessageWrapper('Missing dependencies "zod-to-json-schema".')
16
+ );
17
+ }).then(
17
18
  (mod) => mod.zodToJsonSchema
18
19
  );
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-json",
3
- "version": "0.3.0-rc.2",
3
+ "version": "0.3.0-rc.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",