UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

19 lines (17 loc) 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const ts = require("typescript"); function NamespaceChildableNode(Base) { return class extends Base { getParentNamespace() { let parent = this.getParentOrThrow(); if (parent.getKind() !== ts.SyntaxKind.ModuleBlock) return undefined; while (parent.getParentOrThrow().getKind() === ts.SyntaxKind.ModuleDeclaration) parent = parent.getParentOrThrow(); return parent; } }; } exports.NamespaceChildableNode = NamespaceChildableNode; //# sourceMappingURL=NamespaceChildableNode.js.map