Skip to content

Commit 502e2d0

Browse files
IvanGoncharovyaacovCR
authored andcommitted
Remove deprecated getVisitFn function (graphql#3580)
1 parent 6856282 commit 502e2d0

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ export {
221221
// Visit
222222
visit,
223223
visitInParallel,
224-
getVisitFn,
225224
getEnterLeaveForKind,
226225
BREAK,
227226
Kind,

src/language/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ export type { ParseOptions } from './parser';
2222

2323
export { print } from './printer';
2424

25-
export {
26-
visit,
27-
visitInParallel,
28-
getVisitFn,
29-
getEnterLeaveForKind,
30-
BREAK,
31-
} from './visitor';
25+
export { visit, visitInParallel, getEnterLeaveForKind, BREAK } from './visitor';
3226
export type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from './visitor';
3327

3428
export { Location, Token, OperationTypeNode } from './ast';

src/language/visitor.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -391,19 +391,3 @@ export function getEnterLeaveForKind(
391391
// { enter() {}, leave() {} }
392392
return { enter: (visitor as any).enter, leave: (visitor as any).leave };
393393
}
394-
395-
/**
396-
* Given a visitor instance, if it is leaving or not, and a node kind, return
397-
* the function the visitor runtime should call.
398-
*
399-
* @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17
400-
*/
401-
/* c8 ignore next 8 */
402-
export function getVisitFn(
403-
visitor: ASTVisitor,
404-
kind: Kind,
405-
isLeaving: boolean,
406-
): ASTVisitFn<ASTNode> | undefined {
407-
const { enter, leave } = getEnterLeaveForKind(visitor, kind);
408-
return isLeaving ? leave : enter;
409-
}

0 commit comments

Comments
 (0)