@standard-community/standard-json 0.3.0-rc.3 → 0.3.0-rc.5
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/effect-BdLFlbKK.cjs +14 -0
- package/dist/effect-upmsZks7.js +12 -0
- package/dist/{index-Bx2xBXfI.cjs → index-CeYTpXSN.cjs} +3 -11
- package/dist/{index-BCoFb8WC.js → index-TV3as6RE.js} +4 -11
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/valibot-DW5hlWjk.cjs +14 -0
- package/dist/valibot-f_9pHZHS.js +12 -0
- package/dist/zod-CQLI5Nm9.js +23 -0
- package/dist/zod-CTiow-o0.cjs +25 -0
- package/package.json +1 -1
- package/dist/effect-BHXCUs57.js +0 -8
- package/dist/effect-Btg6OWP3.cjs +0 -10
- package/dist/valibot-B3sSM057.js +0 -11
- package/dist/valibot-D9XXvyYJ.cjs +0 -13
- package/dist/zod-6IWvQABX.js +0 -23
- package/dist/zod-P2Lea6ZA.cjs +0 -25
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CeYTpXSN.cjs');
|
|
4
|
+
|
|
5
|
+
async function getToJsonSchemaFn() {
|
|
6
|
+
try {
|
|
7
|
+
const { JSONSchema } = await import('effect');
|
|
8
|
+
return (schema) => JSONSchema.make(schema);
|
|
9
|
+
} catch {
|
|
10
|
+
throw new Error(index.errorMessageWrapper('Missing dependencies "effect".'));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.default = getToJsonSchemaFn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { e as errorMessageWrapper } from './index-TV3as6RE.js';
|
|
2
|
+
|
|
3
|
+
async function getToJsonSchemaFn() {
|
|
4
|
+
try {
|
|
5
|
+
const { JSONSchema } = await import('effect');
|
|
6
|
+
return (schema) => JSONSchema.make(schema);
|
|
7
|
+
} catch {
|
|
8
|
+
throw new Error(errorMessageWrapper('Missing dependencies "effect".'));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { getToJsonSchemaFn as default };
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const errorMessageWrapper = (message) => `standard-json: ${message}`;
|
|
4
|
-
const tryImport = async (result, name) => {
|
|
5
|
-
try {
|
|
6
|
-
return await result;
|
|
7
|
-
} catch {
|
|
8
|
-
throw new Error(errorMessageWrapper(`Missing dependencies "${name}".`));
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
4
|
|
|
12
5
|
const getToJsonSchemaFn = async (vendor) => {
|
|
13
6
|
switch (vendor) {
|
|
14
7
|
case "arktype":
|
|
15
8
|
return (await Promise.resolve().then(function () { return require('./arktype-BCitmcgd.cjs'); })).default();
|
|
16
9
|
case "effect":
|
|
17
|
-
return (await Promise.resolve().then(function () { return require('./effect-
|
|
10
|
+
return (await Promise.resolve().then(function () { return require('./effect-BdLFlbKK.cjs'); })).default();
|
|
18
11
|
case "valibot":
|
|
19
|
-
return (await Promise.resolve().then(function () { return require('./valibot-
|
|
12
|
+
return (await Promise.resolve().then(function () { return require('./valibot-DW5hlWjk.cjs'); })).default();
|
|
20
13
|
case "zod":
|
|
21
|
-
return (await Promise.resolve().then(function () { return require('./zod-
|
|
14
|
+
return (await Promise.resolve().then(function () { return require('./zod-CTiow-o0.cjs'); })).default();
|
|
22
15
|
default:
|
|
23
16
|
throw new Error(
|
|
24
17
|
errorMessageWrapper(`Unsupported schema vendor "${vendor}".`)
|
|
@@ -32,4 +25,3 @@ const toJsonSchema = (schema, options) => getToJsonSchemaFn(schema["~standard"].
|
|
|
32
25
|
|
|
33
26
|
exports.errorMessageWrapper = errorMessageWrapper;
|
|
34
27
|
exports.toJsonSchema = toJsonSchema;
|
|
35
|
-
exports.tryImport = tryImport;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
const errorMessageWrapper = (message) => `standard-json: ${message}`;
|
|
2
|
-
const tryImport = async (result, name) => {
|
|
3
|
-
try {
|
|
4
|
-
return await result;
|
|
5
|
-
} catch {
|
|
6
|
-
throw new Error(errorMessageWrapper(`Missing dependencies "${name}".`));
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
2
|
|
|
10
3
|
const getToJsonSchemaFn = async (vendor) => {
|
|
11
4
|
switch (vendor) {
|
|
12
5
|
case "arktype":
|
|
13
6
|
return (await import('./arktype-DUDu5yUt.js')).default();
|
|
14
7
|
case "effect":
|
|
15
|
-
return (await import('./effect-
|
|
8
|
+
return (await import('./effect-upmsZks7.js')).default();
|
|
16
9
|
case "valibot":
|
|
17
|
-
return (await import('./valibot-
|
|
10
|
+
return (await import('./valibot-f_9pHZHS.js')).default();
|
|
18
11
|
case "zod":
|
|
19
|
-
return (await import('./zod-
|
|
12
|
+
return (await import('./zod-CQLI5Nm9.js')).default();
|
|
20
13
|
default:
|
|
21
14
|
throw new Error(
|
|
22
15
|
errorMessageWrapper(`Unsupported schema vendor "${vendor}".`)
|
|
@@ -28,4 +21,4 @@ const toJsonSchema = (schema, options) => getToJsonSchemaFn(schema["~standard"].
|
|
|
28
21
|
(toJsonSchema2) => toJsonSchema2(schema, options)
|
|
29
22
|
);
|
|
30
23
|
|
|
31
|
-
export {
|
|
24
|
+
export { errorMessageWrapper as e, toJsonSchema as t };
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { t as toJsonSchema } from './index-TV3as6RE.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CeYTpXSN.cjs');
|
|
4
|
+
|
|
5
|
+
async function getToJsonSchemaFn() {
|
|
6
|
+
try {
|
|
7
|
+
const { toJsonSchema } = await import('@valibot/to-json-schema');
|
|
8
|
+
return toJsonSchema;
|
|
9
|
+
} catch {
|
|
10
|
+
throw new Error(index.errorMessageWrapper('Missing dependencies "@valibot/to-json-schema".'));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.default = getToJsonSchemaFn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { e as errorMessageWrapper } from './index-TV3as6RE.js';
|
|
2
|
+
|
|
3
|
+
async function getToJsonSchemaFn() {
|
|
4
|
+
try {
|
|
5
|
+
const { toJsonSchema } = await import('@valibot/to-json-schema');
|
|
6
|
+
return toJsonSchema;
|
|
7
|
+
} catch {
|
|
8
|
+
throw new Error(errorMessageWrapper('Missing dependencies "@valibot/to-json-schema".'));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { getToJsonSchemaFn as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { e as errorMessageWrapper } from './index-TV3as6RE.js';
|
|
2
|
+
|
|
3
|
+
async function getToJsonSchemaFn() {
|
|
4
|
+
return async (schema, options) => {
|
|
5
|
+
let handler;
|
|
6
|
+
if ("_zod" in schema) {
|
|
7
|
+
try {
|
|
8
|
+
handler = await import('zod/v4/core').then((mod) => mod.toJSONSchema);
|
|
9
|
+
} catch {
|
|
10
|
+
throw new Error(errorMessageWrapper('Missing dependencies "zod v4".'));
|
|
11
|
+
}
|
|
12
|
+
} else {
|
|
13
|
+
try {
|
|
14
|
+
handler = await import('zod-to-json-schema').then((mod) => mod.zodToJsonSchema);
|
|
15
|
+
} catch {
|
|
16
|
+
throw new Error(errorMessageWrapper('Missing dependencies "zod-to-json-schema".'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return handler(schema, options);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { getToJsonSchemaFn as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CeYTpXSN.cjs');
|
|
4
|
+
|
|
5
|
+
async function getToJsonSchemaFn() {
|
|
6
|
+
return async (schema, options) => {
|
|
7
|
+
let handler;
|
|
8
|
+
if ("_zod" in schema) {
|
|
9
|
+
try {
|
|
10
|
+
handler = await import('zod/v4/core').then((mod) => mod.toJSONSchema);
|
|
11
|
+
} catch {
|
|
12
|
+
throw new Error(index.errorMessageWrapper('Missing dependencies "zod v4".'));
|
|
13
|
+
}
|
|
14
|
+
} else {
|
|
15
|
+
try {
|
|
16
|
+
handler = await import('zod-to-json-schema').then((mod) => mod.zodToJsonSchema);
|
|
17
|
+
} catch {
|
|
18
|
+
throw new Error(index.errorMessageWrapper('Missing dependencies "zod-to-json-schema".'));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return handler(schema, options);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.default = getToJsonSchemaFn;
|
package/package.json
CHANGED
package/dist/effect-BHXCUs57.js
DELETED
package/dist/effect-Btg6OWP3.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Bx2xBXfI.cjs');
|
|
4
|
-
|
|
5
|
-
async function getToJsonSchemaFn() {
|
|
6
|
-
const { JSONSchema } = await index.tryImport(import('effect'), "effect");
|
|
7
|
-
return (schema) => JSONSchema.make(schema);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
exports.default = getToJsonSchemaFn;
|
package/dist/valibot-B3sSM057.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { t as tryImport } from './index-BCoFb8WC.js';
|
|
2
|
-
|
|
3
|
-
async function getToJsonSchemaFn() {
|
|
4
|
-
const { toJsonSchema } = await tryImport(
|
|
5
|
-
import('@valibot/to-json-schema'),
|
|
6
|
-
"@valibot/to-json-schema"
|
|
7
|
-
);
|
|
8
|
-
return toJsonSchema;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { getToJsonSchemaFn as default };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Bx2xBXfI.cjs');
|
|
4
|
-
|
|
5
|
-
async function getToJsonSchemaFn() {
|
|
6
|
-
const { toJsonSchema } = await index.tryImport(
|
|
7
|
-
import('@valibot/to-json-schema'),
|
|
8
|
-
"@valibot/to-json-schema"
|
|
9
|
-
);
|
|
10
|
-
return toJsonSchema;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports.default = getToJsonSchemaFn;
|
package/dist/zod-6IWvQABX.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { t as tryImport, e as errorMessageWrapper } from './index-BCoFb8WC.js';
|
|
2
|
-
|
|
3
|
-
async function getToJsonSchemaFn() {
|
|
4
|
-
return async (schema, options) => {
|
|
5
|
-
let handler;
|
|
6
|
-
if ("_zod" in schema) {
|
|
7
|
-
handler = await tryImport(import('zod/v4/core'), "zod v4").then(
|
|
8
|
-
(mod) => mod.toJSONSchema
|
|
9
|
-
);
|
|
10
|
-
} else {
|
|
11
|
-
handler = await import('zod-to-json-schema').catch(() => {
|
|
12
|
-
throw new Error(
|
|
13
|
-
errorMessageWrapper('Missing dependencies "zod-to-json-schema".')
|
|
14
|
-
);
|
|
15
|
-
}).then(
|
|
16
|
-
(mod) => mod.zodToJsonSchema
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
return handler(schema, options);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { getToJsonSchemaFn as default };
|
package/dist/zod-P2Lea6ZA.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Bx2xBXfI.cjs');
|
|
4
|
-
|
|
5
|
-
async function getToJsonSchemaFn() {
|
|
6
|
-
return async (schema, options) => {
|
|
7
|
-
let handler;
|
|
8
|
-
if ("_zod" in schema) {
|
|
9
|
-
handler = await index.tryImport(import('zod/v4/core'), "zod v4").then(
|
|
10
|
-
(mod) => mod.toJSONSchema
|
|
11
|
-
);
|
|
12
|
-
} else {
|
|
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(
|
|
18
|
-
(mod) => mod.zodToJsonSchema
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
return handler(schema, options);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
exports.default = getToJsonSchemaFn;
|