File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,14 @@ export function parseKDL(kdlText: string) {
42
42
if ( typeof enumName !== "string" ) {
43
43
throw new Error ( "Missing enum name" ) ;
44
44
}
45
- let name = enumName ;
45
+ const name = enumName ;
46
46
const values : string [ ] = [ ] ;
47
47
48
48
for ( const child of node . children ?? [ ] ) {
49
49
if ( child . name !== "value" || typeof child . values [ 0 ] !== "string" ) {
50
- throw new Error ( "enum values should be in the form of `value {name}`" ) ;
50
+ throw new Error (
51
+ "enum values should be in the form of `value {name}`" ,
52
+ ) ;
51
53
}
52
54
values . push ( child . values [ 0 ] ) ;
53
55
}
@@ -144,5 +146,5 @@ export default async function readKDL(
144
146
145
147
const parsedContents = await Promise . all ( fileUrls . map ( readInputKDL ) ) ;
146
148
147
- return parsedContents . reduce ( merge , { } ) ;
149
+ return parsedContents . reduce ( ( acc , current ) => merge ( acc , current ) , { } ) ;
148
150
}
You can’t perform that action at this time.
0 commit comments