Skip to content

Commit 4f15c5d

Browse files
committed
-
1 parent 56f7ebf commit 4f15c5d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/build/utils/kdl.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ export function parseKDL(kdlText: string) {
4242
if (typeof enumName !== "string") {
4343
throw new Error("Missing enum name");
4444
}
45-
let name = enumName;
45+
const name = enumName;
4646
const values: string[] = [];
4747

4848
for (const child of node.children ?? []) {
4949
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+
);
5153
}
5254
values.push(child.values[0]);
5355
}
@@ -144,5 +146,5 @@ export default async function readKDL(
144146

145147
const parsedContents = await Promise.all(fileUrls.map(readInputKDL));
146148

147-
return parsedContents.reduce(merge, {});
149+
return parsedContents.reduce((acc, current) => merge(acc, current), {});
148150
}

0 commit comments

Comments
 (0)