@optique/valibot 1.0.0-dev.465 → 1.0.0-dev.466
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 +5 -4
- package/dist/index.js +5 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -46,10 +46,11 @@ const valibot = __toESM(require("valibot"));
|
|
|
46
46
|
* @since 0.7.0
|
|
47
47
|
*/
|
|
48
48
|
function inferMetavar(schema) {
|
|
49
|
-
const
|
|
49
|
+
const internalSchema = schema;
|
|
50
|
+
const schemaType = internalSchema.type;
|
|
50
51
|
if (!schemaType) return "VALUE";
|
|
51
52
|
if (schemaType === "string") {
|
|
52
|
-
const pipeline =
|
|
53
|
+
const pipeline = internalSchema.pipe;
|
|
53
54
|
if (Array.isArray(pipeline)) for (const action of pipeline) {
|
|
54
55
|
const actionType = action.type;
|
|
55
56
|
if (actionType === "transform") return "VALUE";
|
|
@@ -71,7 +72,7 @@ function inferMetavar(schema) {
|
|
|
71
72
|
return "STRING";
|
|
72
73
|
}
|
|
73
74
|
if (schemaType === "number") {
|
|
74
|
-
const pipeline =
|
|
75
|
+
const pipeline = internalSchema.pipe;
|
|
75
76
|
if (Array.isArray(pipeline)) for (const action of pipeline) {
|
|
76
77
|
const actionType = action.type;
|
|
77
78
|
if (actionType === "transform") return "VALUE";
|
|
@@ -85,7 +86,7 @@ function inferMetavar(schema) {
|
|
|
85
86
|
if (schemaType === "literal") return "VALUE";
|
|
86
87
|
if (schemaType === "union" || schemaType === "variant") return "VALUE";
|
|
87
88
|
if (schemaType === "optional" || schemaType === "nullable" || schemaType === "nullish") {
|
|
88
|
-
const wrapped =
|
|
89
|
+
const wrapped = internalSchema.wrapped;
|
|
89
90
|
if (wrapped) return inferMetavar(wrapped);
|
|
90
91
|
}
|
|
91
92
|
return "VALUE";
|
package/dist/index.js
CHANGED
|
@@ -23,10 +23,11 @@ import { safeParse } from "valibot";
|
|
|
23
23
|
* @since 0.7.0
|
|
24
24
|
*/
|
|
25
25
|
function inferMetavar(schema) {
|
|
26
|
-
const
|
|
26
|
+
const internalSchema = schema;
|
|
27
|
+
const schemaType = internalSchema.type;
|
|
27
28
|
if (!schemaType) return "VALUE";
|
|
28
29
|
if (schemaType === "string") {
|
|
29
|
-
const pipeline =
|
|
30
|
+
const pipeline = internalSchema.pipe;
|
|
30
31
|
if (Array.isArray(pipeline)) for (const action of pipeline) {
|
|
31
32
|
const actionType = action.type;
|
|
32
33
|
if (actionType === "transform") return "VALUE";
|
|
@@ -48,7 +49,7 @@ function inferMetavar(schema) {
|
|
|
48
49
|
return "STRING";
|
|
49
50
|
}
|
|
50
51
|
if (schemaType === "number") {
|
|
51
|
-
const pipeline =
|
|
52
|
+
const pipeline = internalSchema.pipe;
|
|
52
53
|
if (Array.isArray(pipeline)) for (const action of pipeline) {
|
|
53
54
|
const actionType = action.type;
|
|
54
55
|
if (actionType === "transform") return "VALUE";
|
|
@@ -62,7 +63,7 @@ function inferMetavar(schema) {
|
|
|
62
63
|
if (schemaType === "literal") return "VALUE";
|
|
63
64
|
if (schemaType === "union" || schemaType === "variant") return "VALUE";
|
|
64
65
|
if (schemaType === "optional" || schemaType === "nullable" || schemaType === "nullish") {
|
|
65
|
-
const wrapped =
|
|
66
|
+
const wrapped = internalSchema.wrapped;
|
|
66
67
|
if (wrapped) return inferMetavar(wrapped);
|
|
67
68
|
}
|
|
68
69
|
return "VALUE";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/valibot",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.466+f096ac54",
|
|
4
4
|
"description": "Valibot value parsers for Optique",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"valibot": "^1.2.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@optique/core": "1.0.0-dev.
|
|
60
|
+
"@optique/core": "1.0.0-dev.466+f096ac54"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "^20.19.9",
|