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

Function TSModuleDeclaration

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

Source from the content-addressed store, hash-verified

633}
634
635export function TSModuleDeclaration(
636 this: Printer,
637 node: t.TSModuleDeclaration,
638) {
639 const { declare, kind } = node;
640
641 if (declare) {
642 this.word("declare");
643 this.space();
644 }
645
646 if (kind !== "global") {
647 this.word(kind);
648 this.space();
649 }
650
651 this.print(node.id);
652 if (!node.body) {
653 this.semicolon();
654 return;
655 }
656 this.space();
657 this.print(node.body);
658}
659
660export function TSModuleBlock(this: Printer, node: t.TSModuleBlock) {
661 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