diff --git a/packages/parser/src/index.ts b/packages/parser/src/index.ts index 5a766da..66e9e9b 100644 --- a/packages/parser/src/index.ts +++ b/packages/parser/src/index.ts @@ -1,2 +1,3 @@ export * from './parser'; +export * from './stringifier'; export * from './utils'; diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index fd18363..d0795e4 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -9,8 +9,6 @@ import { Stringifier, StringifierOpts } from './stringifier'; import { TokenType } from './tokens'; import { getIdentifierFromStr } from './utils'; -export { StringifierOpts } from './stringifier'; - const parseWithAcorn = (source: string, loc: number) => { const JSXParser = AcornParser.extend(jsx()); diff --git a/packages/parser/src/stringifier.ts b/packages/parser/src/stringifier.ts index 1c74af8..4ac2361 100644 --- a/packages/parser/src/stringifier.ts +++ b/packages/parser/src/stringifier.ts @@ -6,10 +6,7 @@ import { EXTERNAL_IDENTIFIER_PREFIX_SYMBOL } from './utils'; import { Writer, WriterResult } from './writer'; export type StringifierOpts = { - onStringifyNode: ( - node: t.ASTNode, - stringifier: _Stringifier - ) => t.ASTNode | null | undefined; + onStringifyNode: (node: t.ASTNode) => t.ASTNode | null | undefined; }; class _Stringifier { @@ -101,7 +98,7 @@ class _Stringifier { } stringify(node: t.ASTNode, precedence: Precedence = Precedence.Sequence) { - const value = this.opts.onStringifyNode(node, this); + const value = this.opts.onStringifyNode(node); if (value) { node = value;