Skip to content

Commit ae53355

Browse files
authored
Allow visitors to return undefined
While implementing `ts.Visitor`, it is possible to return `undefined` in order to drop a node. However, the typings do not reflect this and only allow to return `Node | Node []`. This PR extends the typings to allow `undefined` as well.
1 parent ff5d245 commit ae53355

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4350,7 +4350,7 @@ namespace ts {
43504350
*/
43514351
export type Visitor = (node: Node) => VisitResult<Node>;
43524352

4353-
export type VisitResult<T extends Node> = T | T[];
4353+
export type VisitResult<T extends Node> = T | T[] | undefined;
43544354

43554355
export interface Printer {
43564356
/**

0 commit comments

Comments
 (0)