Skip to content

Commit 8c2aa44

Browse files
committed
recursively
1 parent 58e6d23 commit 8c2aa44

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/build/patches.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
Interface,
77
WebIdl,
88
Method,
9+
Typed,
910
} from "./types.js";
1011
import { readdir, readFile } from "fs/promises";
1112
import { merge } from "./helpers.js";
@@ -39,13 +40,11 @@ function string(arg: unknown): string {
3940
return arg;
4041
}
4142

42-
function handleTyped(type: Node, returnType?: Value) {
43+
function handleTyped(type: Node, returnType?: Value): Typed {
4344
const isTyped = type.name == "type";
4445
const name = string(isTyped ? type.values[0] : returnType);
4546
const subType =
46-
type.children.length > 0
47-
? { type: string(type.children[0].values[0]) }
48-
: undefined;
47+
type.children.length > 0 ? handleTyped(type.children[0], name) : undefined;
4948
return {
5049
type: name,
5150
subtype: subType,

0 commit comments

Comments
 (0)