Skip to content

Commit 8534e92

Browse files
committed
☕ Generate function definition for function without arguments
Close #43
1 parent 4649885 commit 8534e92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/gen-function/format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function formatDocs(docs: string): string[] {
1515
}
1616

1717
function formatVariants(fn: string, vars: Variant[]): string[] {
18+
if (vars.length === 0) {
19+
return formatVariants(fn, [[]]);
20+
}
1821
const lines = vars.map((variant) => {
1922
const args = variant.map(({ name, optional }) => {
2023
name = translate[name] ?? name;

0 commit comments

Comments
 (0)