@standard-community/standard-json 0.1.0 → 0.1.1
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/README.md +22 -4
- package/dist/arktype-CqF_-yop.js +1 -0
- package/dist/arktype-Dlvt2KS_.cjs +1 -0
- package/dist/effect-DhPQdyvU.cjs +1 -0
- package/dist/effect-pZiNZiGm.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/valibot--kGNOzEb.cjs +1 -0
- package/dist/valibot-bjxbIVdF.js +1 -0
- package/dist/zod-BgKiXEg9.js +1 -0
- package/dist/zod-CaS8MF0R.cjs +1 -0
- package/package.json +14 -13
- package/dist/arktype-BLC3CdrE.cjs +0 -1
- package/dist/arktype-ZJN3SbO2.js +0 -1
- package/dist/valibot-BKk6QhzV.js +0 -1
- package/dist/valibot-KN6if2LL.cjs +0 -1
- package/dist/zod-BnLkqCQl.cjs +0 -1
- package/dist/zod-CcYrCVyl.js +0 -1
package/README.md
CHANGED
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
Standard Schema Validator's JSON Schema Converter
|
|
8
8
|
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install the main package -
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pnpm add @standard-community/standard-json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For some specific vendor, install the respective package also -
|
|
18
|
+
|
|
19
|
+
| Vendor | Package |
|
|
20
|
+
| ------- | ------- |
|
|
21
|
+
| Zod | `zod-to-json-schema` |
|
|
22
|
+
| Valibot | `@valibot/to-json-schema` |
|
|
23
|
+
|
|
9
24
|
## Usage
|
|
10
25
|
|
|
11
26
|
```ts
|
|
@@ -28,11 +43,14 @@ const jsonSchema = await toJsonSchema(schema);
|
|
|
28
43
|
|
|
29
44
|
List of supported validators -
|
|
30
45
|
|
|
31
|
-
| Vendor |
|
|
46
|
+
| Vendor | Supported |
|
|
32
47
|
| ------- | ------- |
|
|
33
|
-
| Zod |
|
|
34
|
-
| Valibot |
|
|
35
|
-
| ArkType |
|
|
48
|
+
| Zod | ✅ |
|
|
49
|
+
| Valibot | ✅ |
|
|
50
|
+
| ArkType | ✅ |
|
|
51
|
+
| Effect Schema | 🛠️ |
|
|
52
|
+
|
|
53
|
+
You can check the compatibility versions at [standardschema.dev](https://standardschema.dev/)
|
|
36
54
|
|
|
37
55
|
## Credit
|
|
38
56
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var t=(o,c)=>e(o,"name",{value:c,configurable:!0});const n=t(o=>o.toJsonSchema(),"toJsonSchema");export{n as toJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var s=(o,t)=>c(o,"name",{value:t,configurable:!0});const e=s(o=>o.toJsonSchema(),"toJsonSchema");exports.toJsonSchema=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=(e,t)=>a(e,"name",{value:t,configurable:!0});var o=require("effect");const s=c(e=>o.JSONSchema.make(e),"toJsonSchema");exports.toJsonSchema=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var m=(o,e)=>t(o,"name",{value:e,configurable:!0});import{JSONSchema as a}from"effect";const c=m(o=>a.make(o),"toJsonSchema");export{c as toJsonSchema};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var t=(r,n)=>o(r,"name",{value:n,configurable:!0});const s=t(async r=>{const n=r["~standard"].vendor;let e;switch(n){case"arktype":e=Promise.resolve().then(function(){return require("./arktype-Dlvt2KS_.cjs")});break;case"effect":e=Promise.resolve().then(function(){return require("./effect-DhPQdyvU.cjs")});break;case"valibot":e=Promise.resolve().then(function(){return require("./valibot--kGNOzEb.cjs")});break;case"zod":e=Promise.resolve().then(function(){return require("./zod-CaS8MF0R.cjs")});break;default:throw new Error(`standard-json: Unsupported schema vendor "${n}"`)}return(await e).toJsonSchema(r)},"toJsonSchema");exports.toJsonSchema=s;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=Object.defineProperty;var t=(r,o)=>a(r,"name",{value:o,configurable:!0});const n=t(async r=>{const o=r["~standard"].vendor;let e;switch(o){case"arktype":e=import("./arktype-CqF_-yop.js");break;case"effect":e=import("./effect-pZiNZiGm.js");break;case"valibot":e=import("./valibot-bjxbIVdF.js");break;case"zod":e=import("./zod-BgKiXEg9.js");break;default:throw new Error(`standard-json: Unsupported schema vendor "${o}"`)}return(await e).toJsonSchema(r)},"toJsonSchema");export{n as toJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var e=(o,s)=>t(o,"name",{value:s,configurable:!0});var c=require("@valibot/to-json-schema");const a=e(o=>c.toJsonSchema(o),"toJsonSchema");exports.toJsonSchema=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(o,m)=>s(o,"name",{value:m,configurable:!0});import{toJsonSchema as a}from"@valibot/to-json-schema";const c=t(o=>a(o),"toJsonSchema");export{c as toJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var m=(o,t)=>c(o,"name",{value:t,configurable:!0});import{zodToJsonSchema as e}from"zod-to-json-schema";const n=m(o=>e(o),"toJsonSchema");export{n as toJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var e=(o,s)=>c(o,"name",{value:s,configurable:!0});var a=require("zod-to-json-schema");const n=e(o=>a.zodToJsonSchema(o),"toJsonSchema");exports.toJsonSchema=n;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standard-community/standard-json",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -29,27 +29,25 @@
|
|
|
29
29
|
"url": "https://github.com/standard-community/standard-json/issues"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"default": "./dist/index.cjs"
|
|
40
|
-
}
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/index.d.cts",
|
|
38
|
+
"default": "./dist/index.cjs"
|
|
41
39
|
}
|
|
42
40
|
},
|
|
43
41
|
"peerDependencies": {
|
|
44
42
|
"@valibot/to-json-schema": "^1.0.0-rc.0",
|
|
45
|
-
"
|
|
43
|
+
"effect": "^3.13.10",
|
|
46
44
|
"zod-to-json-schema": "^3.24.1"
|
|
47
45
|
},
|
|
48
46
|
"peerDependenciesMeta": {
|
|
49
47
|
"@valibot/to-json-schema": {
|
|
50
48
|
"optional": true
|
|
51
49
|
},
|
|
52
|
-
"
|
|
50
|
+
"effect": {
|
|
53
51
|
"optional": true
|
|
54
52
|
},
|
|
55
53
|
"zod-to-json-schema": {
|
|
@@ -59,7 +57,10 @@
|
|
|
59
57
|
"devDependencies": {
|
|
60
58
|
"@standard-schema/spec": "^1.0.0",
|
|
61
59
|
"@types/json-schema": "^7.0.15",
|
|
62
|
-
"
|
|
60
|
+
"arktype": "^2.0.4",
|
|
61
|
+
"pkgroll": "^2.5.1",
|
|
62
|
+
"valibot": "^1.0.0-rc.4",
|
|
63
|
+
"zod": "^3.24.2"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
65
66
|
"build": "pkgroll --minify --clean-dist"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty;var s=(o,c)=>t(o,"name",{value:c,configurable:!0});const n=s(async()=>o=>o.toJsonSchema(),"toJsonSchema");exports.toJsonSchema=n;
|
package/dist/arktype-ZJN3SbO2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var c=(o,n)=>s(o,"name",{value:n,configurable:!0});const t=c(async()=>o=>o.toJsonSchema(),"toJsonSchema");export{t as toJsonSchema};
|
package/dist/valibot-BKk6QhzV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var t=(o,n)=>s(o,"name",{value:n,configurable:!0});const a=t(async()=>{try{const{toJsonSchema:o}=await import("@valibot/to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "@valibot/to-json-schema"')}},"toJsonSchema");export{a as toJsonSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=Object.create;var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var e=(o,t)=>a(o,"name",{value:t,configurable:!0});var J=(o,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of i(t))!d.call(o,n)&&n!==s&&a(o,n,{get:()=>t[n],enumerable:!(c=h(t,n))||c.enumerable});return o};var S=(o,t,s)=>(s=o!=null?r(m(o)):{},J(t||!o||!o.__esModule?a(s,"default",{value:o,enumerable:!0}):s,o));const w=e(async()=>{try{const{toJsonSchema:o}=await import("@valibot/to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "@valibot/to-json-schema"')}},"toJsonSchema");exports.toJsonSchema=w;
|
package/dist/zod-BnLkqCQl.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=Object.create;var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var a=(o,s)=>c(o,"name",{value:s,configurable:!0});var w=(o,s,n,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let t of h(s))!m.call(o,t)&&t!==n&&c(o,t,{get:()=>s[t],enumerable:!(e=d(s,t))||e.enumerable});return o};var J=(o,s,n)=>(n=o!=null?r(i(o)):{},w(s||!o||!o.__esModule?c(n,"default",{value:o,enumerable:!0}):n,o));const S=a(async()=>{try{const{zodToJsonSchema:o}=await import("zod-to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "zod-to-json-schema"')}},"toJsonSchema");exports.toJsonSchema=S;
|
package/dist/zod-CcYrCVyl.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty;var n=(o,s)=>t(o,"name",{value:s,configurable:!0});const e=n(async()=>{try{const{zodToJsonSchema:o}=await import("zod-to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "zod-to-json-schema"')}},"toJsonSchema");export{e as toJsonSchema};
|