MCPcopy Create free account
hub / github.com/babel/babel / parseExportSpecifiers

Function parseExportSpecifiers

packages/babel-parser/src/parser/statement.ts:2810–2839  ·  view source on GitHub ↗
(isInTypeExport: boolean)

Source from the content-addressed store, hash-verified

2808 // Parses a comma-separated list of module exports.
2809
2810 parseExportSpecifiers(isInTypeExport: boolean): N.ExportSpecifier[] {
2811 const nodes = [];
2812 let first = true;
2813
2814 // export { x, y as z } [from '...']
2815 this.expect(tt.braceL);
2816
2817 while (!this.eat(tt.braceR)) {
2818 if (first) {
2819 first = false;
2820 } else {
2821 this.expect(tt.comma);
2822 if (this.eat(tt.braceR)) break;
2823 }
2824 const isMaybeTypeOnly = this.isContextual(tt._type);
2825 const isString = this.match(tt.string);
2826 const node = this.startNode<N.ExportSpecifier>();
2827 node.local = this.parseModuleExportName();
2828 nodes.push(
2829 this.parseExportSpecifier(
2830 node,
2831 isString,
2832 isInTypeExport,
2833 isMaybeTypeOnly,
2834 ),
2835 );
2836 }
2837
2838 return nodes;
2839 }
2840
2841 parseExportSpecifier(
2842 node: Undone<N.ExportSpecifier>,

Callers

nothing calls this directly

Calls 3

matchMethod · 0.80
parseExportSpecifierMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected