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

Function parseExportSpecifiers

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

Source from the content-addressed store, hash-verified

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