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.
This commit is contained in:
Filipe Silva
2017-07-09 18:50:45 +01:00
committed by GitHub
parent ff5d245dcb
commit ae533551c2

View File

@@ -4350,7 +4350,7 @@ namespace ts {
*/
export type Visitor = (node: Node) => VisitResult<Node>;
export type VisitResult<T extends Node> = T | T[];
export type VisitResult<T extends Node> = T | T[] | undefined;
export interface Printer {
/**