We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc238c7 commit 56f7ebfCopy full SHA for 56f7ebf
src/build/utils/kdl.ts
@@ -46,15 +46,10 @@ export function parseKDL(kdlText: string) {
46
const values: string[] = [];
47
48
for (const child of node.children ?? []) {
49
- if (
50
- child.name === "value" &&
51
- child.values &&
52
- child.values[0] !== undefined
53
- ) {
54
- values.push(child.values[0]!.toString());
55
- } else if (child.name === "name") {
56
- name = child.values?.[0]?.toString() ?? enumName;
+ if (child.name !== "value" || typeof child.values[0] !== "string") {
+ throw new Error("enum values should be in the form of `value {name}`");
57
}
+ values.push(child.values[0]);
58
59
60
enums[enumName] = { name, value: values };
0 commit comments