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

Function TSModuleDeclaration

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

Source from the content-addressed store, hash-verified

643}
644
645export function TSModuleDeclaration(
646 this: Printer,
647 node: t.TSModuleDeclaration,
648) {
649 const { declare, kind } = node;
650
651 if (declare) {
652 this.word("declare");
653 this.space();
654 }
655
656 if (kind !== "global") {
657 this.word(kind);
658 this.space();
659 }
660
661 this.print(node.id);
662 if (!node.body) {
663 this.semicolon();
664 return;
665 }
666 this.space();
667 this.print(node.body);
668}
669
670export function TSModuleBlock(this: Printer, node: t.TSModuleBlock) {
671 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