Skip to content

Commit 62a7ad0

Browse files
committed
Export getVisitFn function
1 parent 604bf1a commit 62a7ad0

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export {
171171
visit,
172172
visitInParallel,
173173
visitWithTypeInfo,
174+
getVisitFn,
174175
Kind,
175176
TokenKind,
176177
BREAK,

src/language/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export { createLexer, TokenKind } from './lexer';
1515
export { parse, parseValue, parseType } from './parser';
1616
export { print } from './printer';
1717
export { Source } from './source';
18-
export { visit, visitInParallel, visitWithTypeInfo, BREAK } from './visitor';
18+
export {
19+
visit,
20+
visitInParallel,
21+
visitWithTypeInfo,
22+
getVisitFn,
23+
BREAK,
24+
} from './visitor';
1925

2026
export type { Lexer } from './lexer';
2127
export type { ParseOptions } from './parser';

src/language/visitor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export function visitWithTypeInfo(typeInfo, visitor) {
357357
* Given a visitor instance, if it is leaving or not, and a node kind, return
358358
* the function the visitor runtime should call.
359359
*/
360-
function getVisitFn(visitor, kind, isLeaving) {
360+
export function getVisitFn(visitor, kind, isLeaving) {
361361
const kindVisitor = visitor[kind];
362362
if (kindVisitor) {
363363
if (!isLeaving && typeof kindVisitor === 'function') {

0 commit comments

Comments
 (0)