UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

21 lines (19 loc) 692 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const FormattingKind_1 = require("./FormattingKind"); function getClassMemberFormatting(parent, member) { if (parent.isAmbient()) return FormattingKind_1.FormattingKind.Newline; if (hasBody(member)) return FormattingKind_1.FormattingKind.Blankline; return FormattingKind_1.FormattingKind.Newline; } exports.getClassMemberFormatting = getClassMemberFormatting; function hasBody(node) { if (node.isBodyableNode() && node.getBody() != null) return true; if (node.isBodiedNode()) return true; return false; } //# sourceMappingURL=getClassMemberFormatting.js.map