Skip to content

Commit e9ba34b

Browse files
committed
fix: escape ' in enum string values
1 parent 269cd64 commit e9ba34b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default function generateTypesV3(
7373
(node.enum as string[]).map((item) =>
7474
typeof item === "number" || typeof item === "boolean"
7575
? item
76-
: `'${item}'`
76+
: `'${item.replace(/'/g, "\\'")}'`
7777
)
7878
);
7979
}

0 commit comments

Comments
 (0)