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

Function TSModuleDeclaration

packages/babel-generator/src/generators/typescript.ts:641–664  ·  view source on GitHub ↗
(
  this: Printer,
  node: t.TSModuleDeclaration,
)

Source from the content-addressed store, hash-verified

639}
640
641export function TSModuleDeclaration(
642 this: Printer,
643 node: t.TSModuleDeclaration,
644) {
645 const { declare, kind } = node;
646
647 if (declare) {
648 this.word("declare");
649 this.space();
650 }
651
652 if (kind !== "global") {
653 this.word(kind);
654 this.space();
655 }
656
657 this.print(node.id);
658 if (!node.body) {
659 this.semicolon();
660 return;
661 }
662 this.space();
663 this.print(node.body);
664}
665
666export function TSModuleBlock(this: Printer, node: t.TSModuleBlock) {
667 printBraced(this, node, () => this.printSequence(node.body, true, true));

Callers

nothing calls this directly

Calls 4

wordMethod · 0.45
spaceMethod · 0.45
printMethod · 0.45
semicolonMethod · 0.45

Tested by

no test coverage detected