Skip to content

Commit a1a81fa

Browse files
committed
feat: add createASTExportSpecifier()
1 parent b5c9e39 commit a1a81fa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/parser/ast.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,19 @@ export function createASTIdentifier(name: string): ESTreeAST.Identifier {
121121
};
122122
}
123123

124+
interface ExportSpecifierOptions {
125+
local: string;
126+
exported?: string;
127+
}
128+
export function createASTExportSpecifier({
129+
local,
130+
exported,
131+
}: ExportSpecifierOptions): ESTreeAST.ExportSpecifier {
132+
return {
133+
type: 'ExportSpecifier',
134+
local: createASTIdentifier(local),
135+
exported: createASTIdentifier(exported ?? local),
136+
};
137+
}
138+
124139
export type { ESTreeAST, SvelteAST };

0 commit comments

Comments
 (0)