xsschema 0.3.3 → 0.3.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.
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-WDGOcgH7.js';
1
+ import { t as tryImport } from './index-CAcLDIRJ.js';
2
2
 
3
3
  const getToJsonSchemaFn = async () => {
4
4
  const { JSONSchema } = await tryImport(import('effect'), "effect");
@@ -1,7 +1,13 @@
1
1
  const jsonSchema = (schema) => schema;
2
2
  const strictJsonSchema = (schema) => ({
3
3
  ...schema,
4
- additionalProperties: false
4
+ additionalProperties: false,
5
+ properties: schema.properties != null ? Object.fromEntries(
6
+ Object.entries(schema.properties).map(([k, v]) => [
7
+ k,
8
+ v != null && typeof v === "object" && "type" in v && v.type === "object" ? strictJsonSchema(v) : v
9
+ ])
10
+ ) : schema.properties
5
11
  });
6
12
 
7
13
  const missingDependenciesUrl = "https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies";
@@ -17,13 +23,13 @@ const getToJsonSchemaFn = async (vendor) => {
17
23
  case "arktype":
18
24
  return import('./arktype-C-GObzDh.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
19
25
  case "effect":
20
- return import('./effect-DBSVVF8G.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
26
+ return import('./effect--zg3C1LQ.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
21
27
  case "sury":
22
- return import('./sury-GtnkadyM.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
28
+ return import('./sury-s6Akl-oc.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
23
29
  case "valibot":
24
- return import('./valibot-CbgwcZn_.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
30
+ return import('./valibot-DBCeetIe.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
25
31
  case "zod":
26
- return import('./zod-CD8IEU5z.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
32
+ return import('./zod-Bw_60DVU.js').then(async ({ getToJsonSchemaFn: getToJsonSchemaFn2 }) => getToJsonSchemaFn2());
27
33
  default:
28
34
  throw new Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`);
29
35
  }
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { i as initToJsonSchemaSyncVendor, j as jsonSchema, s as strictJsonSchema, a as toJsonSchema, b as toJsonSchemaSync, v as validate } from './index-WDGOcgH7.js';
1
+ export { i as initToJsonSchemaSyncVendor, j as jsonSchema, s as strictJsonSchema, a as toJsonSchema, b as toJsonSchemaSync, v as validate } from './index-CAcLDIRJ.js';
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-WDGOcgH7.js';
1
+ import { t as tryImport } from './index-CAcLDIRJ.js';
2
2
 
3
3
  const getToJsonSchemaFn = async () => {
4
4
  const { toJSONSchema } = await tryImport(import('sury'), "sury");
@@ -1,4 +1,4 @@
1
- import { t as tryImport } from './index-WDGOcgH7.js';
1
+ import { t as tryImport } from './index-CAcLDIRJ.js';
2
2
 
3
3
  const getToJsonSchemaFn = async () => {
4
4
  const { toJsonSchema } = await tryImport(import('@valibot/to-json-schema'), "@valibot/to-json-schema");
@@ -1,4 +1,4 @@
1
- import { m as missingDependenciesUrl } from './index-WDGOcgH7.js';
1
+ import { m as missingDependenciesUrl } from './index-CAcLDIRJ.js';
2
2
 
3
3
  const getToJsonSchemaFn = async () => {
4
4
  let zodV4toJSONSchema = (_schema) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xsschema",
3
3
  "type": "module",
4
- "version": "0.3.3",
4
+ "version": "0.3.5",
5
5
  "description": "extra-small, Standard Schema-based alternative to typeschema.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",