@astrojs/db 0.21.1 → 1.0.0-alpha.0
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.
|
@@ -24,17 +24,6 @@ const errorMap = (issue) => {
|
|
|
24
24
|
`> ${getTypeOrLiteralMsg(error)}`
|
|
25
25
|
) : `> ${prefix(key, getTypeOrLiteralMsg(error))}`
|
|
26
26
|
);
|
|
27
|
-
if (details.length === 0) {
|
|
28
|
-
if ("discriminator" in issue && issue.discriminator && "options" in issue) {
|
|
29
|
-
const options = issue.options;
|
|
30
|
-
if (Array.isArray(options)) {
|
|
31
|
-
details.push(
|
|
32
|
-
`> Expected \`${issue.discriminator}\` to be ${options.map((o) => `\`${stringify(o)}\``).join(" | ")}`
|
|
33
|
-
);
|
|
34
|
-
details.push("> Received `" + stringify(issue.input) + "`");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
27
|
if (details.length === 0) {
|
|
39
28
|
const expectedShapes = [];
|
|
40
29
|
for (const unionErrors of issue.errors) {
|
|
@@ -70,22 +59,6 @@ const errorMap = (issue) => {
|
|
|
70
59
|
return {
|
|
71
60
|
message: messages.concat(details).join("\n")
|
|
72
61
|
};
|
|
73
|
-
} else if (issue.code === "invalid_key") {
|
|
74
|
-
const keyIssues = issue.issues;
|
|
75
|
-
if (Array.isArray(keyIssues) && keyIssues.length > 0) {
|
|
76
|
-
const firstIssue = keyIssues[0];
|
|
77
|
-
const msg = firstIssue.message || "Invalid key in record";
|
|
78
|
-
return { message: prefix(baseErrorPath, msg) };
|
|
79
|
-
}
|
|
80
|
-
return { message: prefix(baseErrorPath, "Invalid key in record") };
|
|
81
|
-
} else if (issue.code === "invalid_element") {
|
|
82
|
-
const elementIssues = issue.issues;
|
|
83
|
-
if (Array.isArray(elementIssues) && elementIssues.length > 0) {
|
|
84
|
-
const firstIssue = elementIssues[0];
|
|
85
|
-
const msg = firstIssue.message || "Invalid element";
|
|
86
|
-
return { message: prefix(baseErrorPath, msg) };
|
|
87
|
-
}
|
|
88
|
-
return { message: prefix(baseErrorPath, "Invalid element") };
|
|
89
62
|
} else if (issue.code === "invalid_type") {
|
|
90
63
|
return {
|
|
91
64
|
message: prefix(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "Add libSQL support to your Astro site",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"cheerio": "1.2.0",
|
|
78
78
|
"expect-type": "^1.3.0",
|
|
79
79
|
"typescript": "^5.9.3",
|
|
80
|
-
"vite": "^
|
|
81
|
-
"astro": "
|
|
80
|
+
"vite": "^8.0.8",
|
|
81
|
+
"astro": "7.0.0-alpha.0",
|
|
82
82
|
"astro-scripts": "0.0.14"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|