Skip to content

Commit 55bc785

Browse files
authored
fix: escape quotes in enum string values (#365)
1 parent 1a74e25 commit 55bc785

File tree

4 files changed

+4304
-2422
lines changed

4 files changed

+4304
-2422
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)