File tree 3 files changed +19
-4
lines changed
3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 52
52
"spark-md5" : " ^3.0.2" ,
53
53
"title" : " ^3.4.4" ,
54
54
"vscode-uri" : " ^3.0.3" ,
55
- "zod" : " 3.19.1"
55
+ "zod" : " 3.19.1" ,
56
+ "zod-validation-error" : " ^0.2.1"
56
57
},
57
58
"devDependencies" : {
58
59
"@types/fast-levenshtein" : " ^0.0.2" ,
62
63
"@types/luxon" : " ^1.25.0" ,
63
64
"@types/minimatch" : " ^3.0.5" ,
64
65
"@types/nanoid-dictionary" : " ^4.2.0" ,
65
- "@types/normalize-path" : " ^3.0.0" ,
66
66
"@types/node" : " 13.11.0" ,
67
+ "@types/normalize-path" : " ^3.0.0" ,
67
68
"@types/semver" : " ^7.3.4" ,
68
69
"@types/title" : " ^3.4.1" ,
69
70
"@types/unist" : " ^2.0.3" ,
Original file line number Diff line number Diff line change 1
1
import { z } from "zod" ;
2
+ import { fromZodError } from "zod-validation-error" ;
2
3
import type { ZodType } from "zod" ;
3
4
import { ok , err } from "./utils" ;
4
5
import type { Result } from "neverthrow" ;
@@ -36,8 +37,7 @@ export const parse = <T extends z.ZodTypeAny>(
36
37
return err (
37
38
new DendronError ( {
38
39
message : [
39
- ...( msg ? [ msg ] : [ ] ) ,
40
- JSON . stringify ( parsed . error . issues , null , 2 ) ,
40
+ fromZodError ( parsed . error , { prefix : msg } ) . message ,
41
41
...( schema . description ? [ `Schema:${ schema . description } ` ] : [ ] ) ,
42
42
] . join ( "\n" ) ,
43
43
} )
Original file line number Diff line number Diff line change 3823
3823
dependencies:
3824
3824
tslib "^2.4.0"
3825
3825
3826
+ "@swc/helpers@^0.4.11":
3827
+ version "0.4.12"
3828
+ resolved "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.12.tgz#203243e78cff3c87c081c97ae548ab33e2503573"
3829
+ integrity sha512-R6RmwS9Dld5lNvwKlPn62+piU+WDG1sMfsnfJioXCciyko/gZ0DQ4Mqglhq1iGU1nQ/RcGkAwfMH+elMSkJH3Q==
3830
+ dependencies:
3831
+ tslib "^2.4.0"
3832
+
3826
3833
"@szmarczak/http-timer@^1.1.2":
3827
3834
version "1.1.2"
3828
3835
resolved "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
@@ -27247,6 +27254,13 @@ zen-observable@^0.8.0:
27247
27254
resolved "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
27248
27255
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
27249
27256
27257
+ zod-validation-error@^0.2.1:
27258
+ version "0.2.1"
27259
+ resolved "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-0.2.1.tgz#d855c8bba835f43692756670d407453424a7ba5b"
27260
+ integrity sha512-zGg6P5EHi5V0dvyEeC8HBZd2pzp7QDKTngkSWgWunljrY+0SHkHyjI519D+u8/37BHkGHAFseWgnZ2Uq8LNFKg==
27261
+ dependencies:
27262
+ "@swc/helpers" "^0.4.11"
27263
+
27250
27264
27251
27265
version "3.19.1"
27252
27266
resolved "https://registry.npmjs.org/zod/-/zod-3.19.1.tgz#112f074a97b50bfc4772d4ad1576814bd8ac4473"
You can’t perform that action at this time.
0 commit comments