diff --git a/deno/ts_morph.d.ts b/deno/ts_morph.d.ts index 661528a23..f1c3ed4dd 100644 --- a/deno/ts_morph.d.ts +++ b/deno/ts_morph.d.ts @@ -3930,17 +3930,17 @@ export declare class Node { * Gets if the node is an AbstractableNode. * @param node - Node to check. */ - static isAbstractableNode(node: T | undefined): node is AbstractableNode & AbstractableNodeExtensionType & T; + static isAbstractable(node: T | undefined): node is AbstractableNode & AbstractableNodeExtensionType & T; /** * Gets if the node is an AmbientableNode. * @param node - Node to check. */ - static isAmbientableNode(node: T | undefined): node is AmbientableNode & AmbientableNodeExtensionType & T; + static isAmbientable(node: T | undefined): node is AmbientableNode & AmbientableNodeExtensionType & T; /** * Gets if the node is an ArgumentedNode. * @param node - Node to check. */ - static isArgumentedNode(node: T | undefined): node is ArgumentedNode & ArgumentedNodeExtensionType & T; + static isArgumented(node: T | undefined): node is ArgumentedNode & ArgumentedNodeExtensionType & T; /** * Gets if the node is an ArrayTypeNode. * @param node - Node to check. @@ -3950,32 +3950,32 @@ export declare class Node { * Gets if the node is an AssertionKeyNamedNode. * @param node - Node to check. */ - static isAssertionKeyNamedNode(node: T | undefined): node is AssertionKeyNamedNode & AssertionKeyNamedNodeExtensionType & T; + static isAssertionKeyNamed(node: T | undefined): node is AssertionKeyNamedNode & AssertionKeyNamedNodeExtensionType & T; /** * Gets if the node is an AsyncableNode. * @param node - Node to check. */ - static isAsyncableNode(node: T | undefined): node is AsyncableNode & AsyncableNodeExtensionType & T; + static isAsyncable(node: T | undefined): node is AsyncableNode & AsyncableNodeExtensionType & T; /** * Gets if the node is an AwaitableNode. * @param node - Node to check. */ - static isAwaitableNode(node: T | undefined): node is AwaitableNode & AwaitableNodeExtensionType & T; + static isAwaitable(node: T | undefined): node is AwaitableNode & AwaitableNodeExtensionType & T; /** * Gets if the node is a BindingNamedNode. * @param node - Node to check. */ - static isBindingNamedNode(node: T | undefined): node is BindingNamedNode & BindingNamedNodeExtensionType & T; + static isBindingNamed(node: T | undefined): node is BindingNamedNode & BindingNamedNodeExtensionType & T; /** * Gets if the node is a BodiedNode. * @param node - Node to check. */ - static isBodiedNode(node: T | undefined): node is BodiedNode & BodiedNodeExtensionType & T; + static isBodied(node: T | undefined): node is BodiedNode & BodiedNodeExtensionType & T; /** * Gets if the node is a BodyableNode. * @param node - Node to check. */ - static isBodyableNode(node: T | undefined): node is BodyableNode & BodyableNodeExtensionType & T; + static isBodyable(node: T | undefined): node is BodyableNode & BodyableNodeExtensionType & T; /** * Gets if the node is a CallSignatureDeclaration. * @param node - Node to check. @@ -3985,7 +3985,7 @@ export declare class Node { * Gets if the node is a ChildOrderableNode. * @param node - Node to check. */ - static isChildOrderableNode(node: T | undefined): node is ChildOrderableNode & ChildOrderableNodeExtensionType & T; + static isChildOrderable(node: T | undefined): node is ChildOrderableNode & ChildOrderableNodeExtensionType & T; /** * Gets if the node is a ClassLikeDeclarationBase. * @param node - Node to check. @@ -4015,27 +4015,27 @@ export declare class Node { * Gets if the node is a DecoratableNode. * @param node - Node to check. */ - static isDecoratableNode(node: T | undefined): node is DecoratableNode & DecoratableNodeExtensionType & T; + static isDecoratable(node: T | undefined): node is DecoratableNode & DecoratableNodeExtensionType & T; /** * Gets if the node is a DotDotDotTokenableNode. * @param node - Node to check. */ - static isDotDotDotTokenableNode(node: T | undefined): node is DotDotDotTokenableNode & DotDotDotTokenableNodeExtensionType & T; + static isDotDotDotTokenable(node: T | undefined): node is DotDotDotTokenableNode & DotDotDotTokenableNodeExtensionType & T; /** * Gets if the node is an ExclamationTokenableNode. * @param node - Node to check. */ - static isExclamationTokenableNode(node: T | undefined): node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType & T; + static isExclamationTokenable(node: T | undefined): node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType & T; /** * Gets if the node is an ExportableNode. * @param node - Node to check. */ - static isExportableNode(node: T | undefined): node is ExportableNode & ExportableNodeExtensionType & T; + static isExportable(node: T | undefined): node is ExportableNode & ExportableNodeExtensionType & T; /** * Gets if the node is an ExportGetableNode. * @param node - Node to check. */ - static isExportGetableNode(node: T | undefined): node is ExportGetableNode & ExportGetableNodeExtensionType & T; + static isExportGetable(node: T | undefined): node is ExportGetableNode & ExportGetableNodeExtensionType & T; /** * Gets if the node is an Expression. * @param node - Node to check. @@ -4045,17 +4045,17 @@ export declare class Node { * Gets if the node is an ExpressionableNode. * @param node - Node to check. */ - static isExpressionableNode(node: T | undefined): node is ExpressionableNode & ExpressionableNodeExtensionType & T; + static isExpressionable(node: T | undefined): node is ExpressionableNode & ExpressionableNodeExtensionType & T; /** * Gets if the node is an ExpressionedNode. * @param node - Node to check. */ - static isExpressionedNode(node: T | undefined): node is ExpressionedNode & ExpressionedNodeExtensionType & T; + static isExpressioned(node: T | undefined): node is ExpressionedNode & ExpressionedNodeExtensionType & T; /** * Gets if the node is an ExtendsClauseableNode. * @param node - Node to check. */ - static isExtendsClauseableNode(node: T | undefined): node is ExtendsClauseableNode & ExtendsClauseableNodeExtensionType & T; + static isExtendsClauseable(node: T | undefined): node is ExtendsClauseableNode & ExtendsClauseableNodeExtensionType & T; /** * Gets if the node is a FalseLiteral. * @param node - Node to check. @@ -4075,7 +4075,7 @@ export declare class Node { * Gets if the node is a GeneratorableNode. * @param node - Node to check. */ - static isGeneratorableNode(node: T | undefined): node is GeneratorableNode & GeneratorableNodeExtensionType & T; + static isGeneratorable(node: T | undefined): node is GeneratorableNode & GeneratorableNodeExtensionType & T; /** * Gets if the node is a GetAccessorDeclaration. * @param node - Node to check. @@ -4085,12 +4085,12 @@ export declare class Node { * Gets if the node is a HeritageClauseableNode. * @param node - Node to check. */ - static isHeritageClauseableNode(node: T | undefined): node is HeritageClauseableNode & HeritageClauseableNodeExtensionType & T; + static isHeritageClauseable(node: T | undefined): node is HeritageClauseableNode & HeritageClauseableNodeExtensionType & T; /** * Gets if the node is a ImplementsClauseableNode. * @param node - Node to check. */ - static isImplementsClauseableNode(node: T | undefined): node is ImplementsClauseableNode & ImplementsClauseableNodeExtensionType & T; + static isImplementsClauseable(node: T | undefined): node is ImplementsClauseableNode & ImplementsClauseableNodeExtensionType & T; /** * Gets if the node is a ImportExpression. * @param node - Node to check. @@ -4120,12 +4120,12 @@ export declare class Node { * Gets if the node is a InitializerExpressionableNode. * @param node - Node to check. */ - static isInitializerExpressionableNode(node: T | undefined): node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType & T; + static isInitializerExpressionable(node: T | undefined): node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType & T; /** * Gets if the node is a InitializerExpressionGetableNode. * @param node - Node to check. */ - static isInitializerExpressionGetableNode(node: T | undefined): node is InitializerExpressionGetableNode & InitializerExpressionGetableNodeExtensionType & T; + static isInitializerExpressionGetable(node: T | undefined): node is InitializerExpressionGetableNode & InitializerExpressionGetableNodeExtensionType & T; /** * Gets if the node is a IntersectionTypeNode. * @param node - Node to check. @@ -4145,7 +4145,7 @@ export declare class Node { * Gets if the node is a JSDocableNode. * @param node - Node to check. */ - static isJSDocableNode(node: T | undefined): node is JSDocableNode & JSDocableNodeExtensionType & T; + static isJSDocable(node: T | undefined): node is JSDocableNode & JSDocableNodeExtensionType & T; /** * Gets if the node is a JSDocPropertyLikeTag. * @param node - Node to check. @@ -4180,12 +4180,12 @@ export declare class Node { * Gets if the node is a JsxAttributedNode. * @param node - Node to check. */ - static isJsxAttributedNode(node: T | undefined): node is JsxAttributedNode & JsxAttributedNodeExtensionType & T; + static isJsxAttributed(node: T | undefined): node is JsxAttributedNode & JsxAttributedNodeExtensionType & T; /** * Gets if the node is a JsxTagNamedNode. * @param node - Node to check. */ - static isJsxTagNamedNode(node: T | undefined): node is JsxTagNamedNode & JsxTagNamedNodeExtensionType & T; + static isJsxTagNamed(node: T | undefined): node is JsxTagNamedNode & JsxTagNamedNodeExtensionType & T; /** * Gets if the node is a LeftHandSideExpression. * @param node - Node to check. @@ -4195,7 +4195,7 @@ export declare class Node { * Gets if the node is a LeftHandSideExpressionedNode. * @param node - Node to check. */ - static isLeftHandSideExpressionedNode(node: T | undefined): node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType & T; + static isLeftHandSideExpressioned(node: T | undefined): node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType & T; /** * Gets if the node is a LiteralExpression. * @param node - Node to check. @@ -4205,7 +4205,7 @@ export declare class Node { * Gets if the node is a LiteralLikeNode. * @param node - Node to check. */ - static isLiteralLikeNode(node: T | undefined): node is LiteralLikeNode & LiteralLikeNodeExtensionType & T; + static isLiteralLike(node: T | undefined): node is LiteralLikeNode & LiteralLikeNodeExtensionType & T; /** * Gets if the node is a LiteralTypeNode. * @param node - Node to check. @@ -4225,32 +4225,32 @@ export declare class Node { * Gets if the node is a ModifierableNode. * @param node - Node to check. */ - static isModifierableNode(node: T | undefined): node is ModifierableNode & ModifierableNodeExtensionType & T; + static isModifierable(node: T | undefined): node is ModifierableNode & ModifierableNodeExtensionType & T; /** * Gets if the node is a ModuleChildableNode. * @param node - Node to check. */ - static isModuleChildableNode(node: T | undefined): node is ModuleChildableNode & ModuleChildableNodeExtensionType & T; + static isModuleChildable(node: T | undefined): node is ModuleChildableNode & ModuleChildableNodeExtensionType & T; /** * Gets if the node is a ModuledNode. * @param node - Node to check. */ - static isModuledNode(node: T | undefined): node is ModuledNode & ModuledNodeExtensionType & T; + static isModuled(node: T | undefined): node is ModuledNode & ModuledNodeExtensionType & T; /** * Gets if the node is a ModuleNamedNode. * @param node - Node to check. */ - static isModuleNamedNode(node: T | undefined): node is ModuleNamedNode & ModuleNamedNodeExtensionType & T; + static isModuleNamed(node: T | undefined): node is ModuleNamedNode & ModuleNamedNodeExtensionType & T; /** * Gets if the node is a NameableNode. * @param node - Node to check. */ - static isNameableNode(node: T | undefined): node is NameableNode & NameableNodeExtensionType & T; + static isNameable(node: T | undefined): node is NameableNode & NameableNodeExtensionType & T; /** * Gets if the node is a NamedNode. * @param node - Node to check. */ - static isNamedNode(node: T | undefined): node is NamedNode & NamedNodeExtensionType & T; + static isNamed(node: T | undefined): node is NamedNode & NamedNodeExtensionType & T; /** * Gets if the node is a NullLiteral. * @param node - Node to check. @@ -4260,12 +4260,12 @@ export declare class Node { * Gets if the node is a OverloadableNode. * @param node - Node to check. */ - static isOverloadableNode(node: T | undefined): node is OverloadableNode & OverloadableNodeExtensionType & T; + static isOverloadable(node: T | undefined): node is OverloadableNode & OverloadableNodeExtensionType & T; /** * Gets if the node is a OverrideableNode. * @param node - Node to check. */ - static isOverrideableNode(node: T | undefined): node is OverrideableNode & OverrideableNodeExtensionType & T; + static isOverrideable(node: T | undefined): node is OverrideableNode & OverrideableNodeExtensionType & T; /** * Gets if the node is a ParameterDeclaration. * @param node - Node to check. @@ -4275,7 +4275,7 @@ export declare class Node { * Gets if the node is a ParameteredNode. * @param node - Node to check. */ - static isParameteredNode(node: T | undefined): node is ParameteredNode & ParameteredNodeExtensionType & T; + static isParametered(node: T | undefined): node is ParameteredNode & ParameteredNodeExtensionType & T; /** * Gets if the node is a ParenthesizedTypeNode. * @param node - Node to check. @@ -4290,47 +4290,47 @@ export declare class Node { * Gets if the node is a PropertyNamedNode. * @param node - Node to check. */ - static isPropertyNamedNode(node: T | undefined): node is PropertyNamedNode & PropertyNamedNodeExtensionType & T; + static isPropertyNamed(node: T | undefined): node is PropertyNamedNode & PropertyNamedNodeExtensionType & T; /** * Gets if the node is a QuestionDotTokenableNode. * @param node - Node to check. */ - static isQuestionDotTokenableNode(node: T | undefined): node is QuestionDotTokenableNode & QuestionDotTokenableNodeExtensionType & T; + static isQuestionDotTokenable(node: T | undefined): node is QuestionDotTokenableNode & QuestionDotTokenableNodeExtensionType & T; /** * Gets if the node is a QuestionTokenableNode. * @param node - Node to check. */ - static isQuestionTokenableNode(node: T | undefined): node is QuestionTokenableNode & QuestionTokenableNodeExtensionType & T; + static isQuestionTokenable(node: T | undefined): node is QuestionTokenableNode & QuestionTokenableNodeExtensionType & T; /** * Gets if the node is a ReadonlyableNode. * @param node - Node to check. */ - static isReadonlyableNode(node: T | undefined): node is ReadonlyableNode & ReadonlyableNodeExtensionType & T; + static isReadonlyable(node: T | undefined): node is ReadonlyableNode & ReadonlyableNodeExtensionType & T; /** * Gets if the node is a ReferenceFindableNode. * @param node - Node to check. */ - static isReferenceFindableNode(node: T | undefined): node is ReferenceFindableNode & ReferenceFindableNodeExtensionType & T; + static isReferenceFindable(node: T | undefined): node is ReferenceFindableNode & ReferenceFindableNodeExtensionType & T; /** * Gets if the node is a RenameableNode. * @param node - Node to check. */ - static isRenameableNode(node: T | undefined): node is RenameableNode & RenameableNodeExtensionType & T; + static isRenameable(node: T | undefined): node is RenameableNode & RenameableNodeExtensionType & T; /** * Gets if the node is a ReturnTypedNode. * @param node - Node to check. */ - static isReturnTypedNode(node: T | undefined): node is ReturnTypedNode & ReturnTypedNodeExtensionType & T; + static isReturnTyped(node: T | undefined): node is ReturnTypedNode & ReturnTypedNodeExtensionType & T; /** * Gets if the node is a ScopeableNode. * @param node - Node to check. */ - static isScopeableNode(node: T | undefined): node is ScopeableNode & ScopeableNodeExtensionType & T; + static isScopeable(node: T | undefined): node is ScopeableNode & ScopeableNodeExtensionType & T; /** * Gets if the node is a ScopedNode. * @param node - Node to check. */ - static isScopedNode(node: T | undefined): node is ScopedNode & ScopedNodeExtensionType & T; + static isScoped(node: T | undefined): node is ScopedNode & ScopedNodeExtensionType & T; /** * Gets if the node is a SetAccessorDeclaration. * @param node - Node to check. @@ -4350,12 +4350,12 @@ export declare class Node { * Gets if the node is a StatementedNode. * @param node - Node to check. */ - static isStatementedNode(node: T | undefined): node is StatementedNode & StatementedNodeExtensionType & T; + static isStatemented(node: T | undefined): node is StatementedNode & StatementedNodeExtensionType & T; /** * Gets if the node is a StaticableNode. * @param node - Node to check. */ - static isStaticableNode(node: T | undefined): node is StaticableNode & StaticableNodeExtensionType & T; + static isStaticable(node: T | undefined): node is StaticableNode & StaticableNodeExtensionType & T; /** * Gets if the node is a SuperExpression. * @param node - Node to check. @@ -4370,7 +4370,7 @@ export declare class Node { * Gets if the node is a TextInsertableNode. * @param node - Node to check. */ - static isTextInsertableNode(node: T | undefined): node is TextInsertableNode & TextInsertableNodeExtensionType & T; + static isTextInsertable(node: T | undefined): node is TextInsertableNode & TextInsertableNodeExtensionType & T; /** * Gets if the node is a ThisExpression. * @param node - Node to check. @@ -4395,7 +4395,7 @@ export declare class Node { * Gets if the node is a TypeArgumentedNode. * @param node - Node to check. */ - static isTypeArgumentedNode(node: T | undefined): node is TypeArgumentedNode & TypeArgumentedNodeExtensionType & T; + static isTypeArgumented(node: T | undefined): node is TypeArgumentedNode & TypeArgumentedNodeExtensionType & T; /** * Gets if the node is a TypeAssertion. * @param node - Node to check. @@ -4405,7 +4405,7 @@ export declare class Node { * Gets if the node is a TypedNode. * @param node - Node to check. */ - static isTypedNode(node: T | undefined): node is TypedNode & TypedNodeExtensionType & T; + static isTyped(node: T | undefined): node is TypedNode & TypedNodeExtensionType & T; /** * Gets if the node is a TypeElement. * @param node - Node to check. @@ -4415,12 +4415,12 @@ export declare class Node { * Gets if the node is a TypeElementMemberedNode. * @param node - Node to check. */ - static isTypeElementMemberedNode(node: T | undefined): node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType & T; + static isTypeElementMembered(node: T | undefined): node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType & T; /** * Gets if the node is a TypeLiteralNode. * @param node - Node to check. */ - static isTypeLiteralNode(node: Node | undefined): node is TypeLiteralNode; + static isTypeLiteral(node: Node | undefined): node is TypeLiteralNode; /** * Gets if the node is a TypeNode. * @param node - Node to check. @@ -4440,22 +4440,22 @@ export declare class Node { * Gets if the node is a TypeParameteredNode. * @param node - Node to check. */ - static isTypeParameteredNode(node: T | undefined): node is TypeParameteredNode & TypeParameteredNodeExtensionType & T; + static isTypeParametered(node: T | undefined): node is TypeParameteredNode & TypeParameteredNodeExtensionType & T; /** * Gets if the node is a TypePredicateNode. * @param node - Node to check. */ - static isTypePredicateNode(node: Node | undefined): node is TypePredicateNode; + static isTypePredicate(node: Node | undefined): node is TypePredicateNode; /** * Gets if the node is a TypeQueryNode. * @param node - Node to check. */ - static isTypeQueryNode(node: Node | undefined): node is TypeQueryNode; + static isTypeQuery(node: Node | undefined): node is TypeQueryNode; /** * Gets if the node is a TypeReferenceNode. * @param node - Node to check. */ - static isTypeReferenceNode(node: Node | undefined): node is TypeReferenceNode; + static isTypeReference(node: Node | undefined): node is TypeReferenceNode; /** * Gets if the node is a UnaryExpression. * @param node - Node to check. @@ -4465,7 +4465,7 @@ export declare class Node { * Gets if the node is a UnaryExpressionedNode. * @param node - Node to check. */ - static isUnaryExpressionedNode(node: T | undefined): node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType & T; + static isUnaryExpressioned(node: T | undefined): node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType & T; /** * Gets if the node is a UnionTypeNode. * @param node - Node to check. @@ -4475,7 +4475,7 @@ export declare class Node { * Gets if the node is a UnwrappableNode. * @param node - Node to check. */ - static isUnwrappableNode(node: T | undefined): node is UnwrappableNode & UnwrappableNodeExtensionType & T; + static isUnwrappable(node: T | undefined): node is UnwrappableNode & UnwrappableNodeExtensionType & T; /** * Gets if the node is a UpdateExpression. * @param node - Node to check. diff --git a/deno/ts_morph.js b/deno/ts_morph.js index 47e3a53df..ad7feef54 100644 --- a/deno/ts_morph.js +++ b/deno/ts_morph.js @@ -585,16 +585,16 @@ var FormattingKind; })(FormattingKind || (FormattingKind = {})); function getClassMemberFormatting(parent, member) { - if (Node.isAmbientableNode(parent) && parent.isAmbient()) + if (Node.isAmbientable(parent) && parent.isAmbient()) return FormattingKind.Newline; if (hasBody$1(member)) return FormattingKind.Blankline; return FormattingKind.Newline; } function hasBody$1(node) { - if (Node.isBodyableNode(node) && node.getBody() != null) + if (Node.isBodyable(node) && node.getBody() != null) return true; - if (Node.isBodiedNode(node)) + if (Node.isBodied(node)) return true; return false; } @@ -619,9 +619,9 @@ function getInterfaceMemberFormatting(parent, member) { } function hasBody(node) { - if (Node.isBodyableNode(node) && node.hasBody()) + if (Node.isBodyable(node) && node.hasBody()) return true; - if (Node.isBodiedNode(node)) + if (Node.isBodied(node)) return true; return Node.isInterfaceDeclaration(node) || Node.isClassDeclaration(node) || Node.isEnumDeclaration(node); } @@ -846,9 +846,9 @@ function getParentContainerOrThrow(parent) { throw new errors.InvalidOperationError("This operation requires the module to have a body."); return innerBody; } - else if (Node.isBodiedNode(parent)) + else if (Node.isBodied(parent)) return parent.getBody(); - else if (Node.isBodyableNode(parent)) + else if (Node.isBodyable(parent)) return parent.getBodyOrThrow(); else return parent; @@ -2250,9 +2250,9 @@ function getReplacementText(node) { throw new errors.InvalidOperationError("This operation requires the module to have a body."); return bodyNode; } - else if (Node.isBodiedNode(node)) + else if (Node.isBodied(node)) return node.getBody(); - else if (Node.isBodyableNode(node)) + else if (Node.isBodyable(node)) return node.getBodyOrThrow(); else throw new errors.NotImplementedError(`Not implemented unwrap scenario for ${node.getKindName()}.`); @@ -2496,7 +2496,7 @@ function insertIntoBracesOrSourceFile(opts) { function getChild(child) { if (child == null) return child; - else if (Node.isOverloadableNode(child)) + else if (Node.isOverloadable(child)) return child.getImplementation() || child; else return child; @@ -2601,12 +2601,12 @@ function removeChildrenWithFormatting(opts) { })); } function removeClassMember(classMember) { - if (Node.isOverloadableNode(classMember)) { + if (Node.isOverloadable(classMember)) { if (classMember.isImplementation()) removeClassMembers([...classMember.getOverloads(), classMember]); else { const parent = classMember.getParentOrThrow(); - if (Node.isAmbientableNode(parent) && parent.isAmbient()) + if (Node.isAmbientable(parent) && parent.isAmbient()) removeClassMembers([classMember]); else removeChildren({ children: [classMember], removeFollowingSpaces: true, removeFollowingNewLines: true }); @@ -3189,17 +3189,17 @@ class Node { } getChildSyntaxList() { let node = this; - if (Node.isBodyableNode(node) || Node.isBodiedNode(node)) { + if (Node.isBodyable(node) || Node.isBodied(node)) { do { - const bodyNode = Node.isBodyableNode(node) ? node.getBody() : node.getBody(); + const bodyNode = Node.isBodyable(node) ? node.getBody() : node.getBody(); if (bodyNode == null) return undefined; node = bodyNode; - } while ((Node.isBodyableNode(node) || Node.isBodiedNode(node)) && node.compilerNode.statements == null); + } while ((Node.isBodyable(node) || Node.isBodied(node)) && node.compilerNode.statements == null); } if (Node.isSourceFile(node) - || Node.isBodyableNode(this) - || Node.isBodiedNode(this) + || Node.isBodyable(this) + || Node.isBodied(this) || Node.isCaseBlock(this) || Node.isCaseClause(this) || Node.isDefaultClause(this) @@ -4017,7 +4017,7 @@ class Node { static isCommentEnumMember(node) { return (node === null || node === void 0 ? void 0 : node.compilerNode)._commentKind == CommentNodeKind.EnumMember; } - static isAbstractableNode(node) { + static isAbstractable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -4031,7 +4031,7 @@ class Node { return false; } } - static isAmbientableNode(node) { + static isAmbientable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -4046,7 +4046,7 @@ class Node { return false; } } - static isArgumentedNode(node) { + static isArgumented(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: @@ -4058,10 +4058,10 @@ class Node { static isArrayTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.ArrayType; } - static isAssertionKeyNamedNode(node) { + static isAssertionKeyNamed(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.AssertEntry; } - static isAsyncableNode(node) { + static isAsyncable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.FunctionDeclaration: @@ -4072,10 +4072,10 @@ class Node { return false; } } - static isAwaitableNode(node) { + static isAwaitable(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.ForOfStatement; } - static isBindingNamedNode(node) { + static isBindingNamed(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.Parameter: @@ -4085,7 +4085,7 @@ class Node { return false; } } - static isBodiedNode(node) { + static isBodied(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.ClassStaticBlockDeclaration: @@ -4095,7 +4095,7 @@ class Node { return false; } } - static isBodyableNode(node) { + static isBodyable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: @@ -4111,7 +4111,7 @@ class Node { static isCallSignatureDeclaration(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.CallSignature; } - static isChildOrderableNode(node) { + static isChildOrderable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.Block: case SyntaxKind.BreakStatement: @@ -4181,7 +4181,7 @@ class Node { static isConstructSignatureDeclaration(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.ConstructSignature; } - static isDecoratableNode(node) { + static isDecoratable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -4195,7 +4195,7 @@ class Node { return false; } } - static isDotDotDotTokenableNode(node) { + static isDotDotDotTokenable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.JsxExpression: @@ -4206,7 +4206,7 @@ class Node { return false; } } - static isExclamationTokenableNode(node) { + static isExclamationTokenable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.PropertyDeclaration: case SyntaxKind.VariableDeclaration: @@ -4215,7 +4215,7 @@ class Node { return false; } } - static isExportableNode(node) { + static isExportable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -4229,7 +4229,7 @@ class Node { return false; } } - static isExportGetableNode(node) { + static isExportGetable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -4306,7 +4306,7 @@ class Node { return false; } } - static isExpressionableNode(node) { + static isExpressionable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ExternalModuleReference: case SyntaxKind.JsxExpression: @@ -4317,7 +4317,7 @@ class Node { return false; } } - static isExpressionedNode(node) { + static isExpressioned(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.AsExpression: case SyntaxKind.CaseClause: @@ -4344,7 +4344,7 @@ class Node { return false; } } - static isExtendsClauseableNode(node) { + static isExtendsClauseable(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.InterfaceDeclaration; } static isFalseLiteral(node) { @@ -4366,7 +4366,7 @@ class Node { static isFunctionTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.FunctionType; } - static isGeneratorableNode(node) { + static isGeneratorable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: @@ -4380,7 +4380,7 @@ class Node { static isGetAccessorDeclaration(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.GetAccessor; } - static isHeritageClauseableNode(node) { + static isHeritageClauseable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -4390,7 +4390,7 @@ class Node { return false; } } - static isImplementsClauseableNode(node) { + static isImplementsClauseable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -4414,7 +4414,7 @@ class Node { static isInferTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.InferType; } - static isInitializerExpressionableNode(node) { + static isInitializerExpressionable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.EnumMember: @@ -4427,7 +4427,7 @@ class Node { return false; } } - static isInitializerExpressionGetableNode(node) { + static isInitializerExpressionGetable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.EnumMember: @@ -4460,7 +4460,7 @@ class Node { static isJSDoc(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.JSDocComment; } - static isJSDocableNode(node) { + static isJSDocable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -4563,7 +4563,7 @@ class Node { static isJSDocUnknownTag(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.JSDocTag; } - static isJsxAttributedNode(node) { + static isJsxAttributed(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxSelfClosingElement: @@ -4572,7 +4572,7 @@ class Node { return false; } } - static isJsxTagNamedNode(node) { + static isJsxTagNamed(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.JsxClosingElement: case SyntaxKind.JsxOpeningElement: @@ -4616,7 +4616,7 @@ class Node { return false; } } - static isLeftHandSideExpressionedNode(node) { + static isLeftHandSideExpressioned(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.Decorator: @@ -4641,7 +4641,7 @@ class Node { return false; } } - static isLiteralLikeNode(node) { + static isLiteralLike(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.BigIntLiteral: case SyntaxKind.JsxText: @@ -4695,7 +4695,7 @@ class Node { return false; } } - static isModifierableNode(node) { + static isModifierable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.ClassDeclaration: @@ -4722,7 +4722,7 @@ class Node { return false; } } - static isModuleChildableNode(node) { + static isModuleChildable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -4735,7 +4735,7 @@ class Node { return false; } } - static isModuledNode(node) { + static isModuled(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.SourceFile: @@ -4744,10 +4744,10 @@ class Node { return false; } } - static isModuleNamedNode(node) { + static isModuleNamed(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.ModuleDeclaration; } - static isNameableNode(node) { + static isNameable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -4758,7 +4758,7 @@ class Node { return false; } } - static isNamedNode(node) { + static isNamed(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportEqualsDeclaration: @@ -4778,7 +4778,7 @@ class Node { static isNullLiteral(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.NullKeyword; } - static isOverloadableNode(node) { + static isOverloadable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: @@ -4788,7 +4788,7 @@ class Node { return false; } } - static isOverrideableNode(node) { + static isOverrideable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.MethodDeclaration: case SyntaxKind.Parameter: @@ -4801,7 +4801,7 @@ class Node { static isParameterDeclaration(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.Parameter; } - static isParameteredNode(node) { + static isParametered(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -4853,7 +4853,7 @@ class Node { return false; } } - static isPropertyNamedNode(node) { + static isPropertyNamed(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.EnumMember: case SyntaxKind.GetAccessor: @@ -4868,7 +4868,7 @@ class Node { return false; } } - static isQuestionDotTokenableNode(node) { + static isQuestionDotTokenable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.ElementAccessExpression: @@ -4878,7 +4878,7 @@ class Node { return false; } } - static isQuestionTokenableNode(node) { + static isQuestionTokenable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: @@ -4893,7 +4893,7 @@ class Node { return false; } } - static isReadonlyableNode(node) { + static isReadonlyable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.IndexSignature: case SyntaxKind.Parameter: @@ -4904,7 +4904,7 @@ class Node { return false; } } - static isReferenceFindableNode(node) { + static isReferenceFindable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.AssertEntry: case SyntaxKind.BindingElement: @@ -4941,7 +4941,7 @@ class Node { return false; } } - static isRenameableNode(node) { + static isRenameable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.AssertEntry: case SyntaxKind.BindingElement: @@ -4979,7 +4979,7 @@ class Node { return false; } } - static isReturnTypedNode(node) { + static isReturnTyped(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -5000,10 +5000,10 @@ class Node { return false; } } - static isScopeableNode(node) { + static isScopeable(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.Parameter; } - static isScopedNode(node) { + static isScoped(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.GetAccessor: @@ -5076,7 +5076,7 @@ class Node { return false; } } - static isStatementedNode(node) { + static isStatemented(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.Block: @@ -5097,7 +5097,7 @@ class Node { return false; } } - static isStaticableNode(node) { + static isStaticable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.GetAccessor: case SyntaxKind.MethodDeclaration: @@ -5114,7 +5114,7 @@ class Node { static isTemplateLiteralTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TemplateLiteralType; } - static isTextInsertableNode(node) { + static isTextInsertable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.Block: @@ -5151,7 +5151,7 @@ class Node { static isTupleTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TupleType; } - static isTypeArgumentedNode(node) { + static isTypeArgumented(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.ImportType: @@ -5164,7 +5164,7 @@ class Node { static isTypeAssertion(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypeAssertionExpression; } - static isTypedNode(node) { + static isTyped(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.AsExpression: case SyntaxKind.NamedTupleMember: @@ -5191,7 +5191,7 @@ class Node { return false; } } - static isTypeElementMemberedNode(node) { + static isTypeElementMembered(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.InterfaceDeclaration: case SyntaxKind.TypeLiteral: @@ -5200,7 +5200,7 @@ class Node { return false; } } - static isTypeLiteralNode(node) { + static isTypeLiteral(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypeLiteral; } static isTypeNode(node) { @@ -5249,7 +5249,7 @@ class Node { static isTypeParameterDeclaration(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypeParameter; } - static isTypeParameteredNode(node) { + static isTypeParametered(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -5271,13 +5271,13 @@ class Node { return false; } } - static isTypePredicateNode(node) { + static isTypePredicate(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypePredicate; } - static isTypeQueryNode(node) { + static isTypeQuery(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypeQuery; } - static isTypeReferenceNode(node) { + static isTypeReference(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.TypeReference; } static isUnaryExpression(node) { @@ -5321,7 +5321,7 @@ class Node { return false; } } - static isUnaryExpressionedNode(node) { + static isUnaryExpressioned(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.AwaitExpression: case SyntaxKind.DeleteExpression: @@ -5336,7 +5336,7 @@ class Node { static isUnionTypeNode(node) { return (node === null || node === void 0 ? void 0 : node.getKind()) === SyntaxKind.UnionType; } - static isUnwrappableNode(node) { + static isUnwrappable(node) { switch (node === null || node === void 0 ? void 0 : node.getKind()) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ModuleDeclaration: @@ -5916,7 +5916,7 @@ function ExclamationTokenableNode(Base) { if (value === hasExclamationToken) return this; if (value) { - if (Node.isQuestionTokenableNode(this)) + if (Node.isQuestionTokenable(this)) this.setHasQuestionToken(false); const colonNode = this.getFirstChildByKind(SyntaxKind.ColonToken); if (colonNode == null) @@ -5956,7 +5956,7 @@ function ExportGetableNode(Base) { const variableStatement = this.getVariableStatement(); return variableStatement === null || variableStatement === void 0 ? void 0 : variableStatement.getExportKeyword(); } - if (!Node.isModifierableNode(this)) + if (!Node.isModifierable(this)) return throwForNotModifierableNode(); return this.getFirstModifierByKind(SyntaxKind.ExportKeyword); } @@ -5971,7 +5971,7 @@ function ExportGetableNode(Base) { const variableStatement = this.getVariableStatement(); return variableStatement === null || variableStatement === void 0 ? void 0 : variableStatement.getDefaultKeyword(); } - if (!Node.isModifierableNode(this)) + if (!Node.isModifierable(this)) return throwForNotModifierableNode(); return this.getFirstModifierByKind(SyntaxKind.DefaultKeyword); } @@ -6051,7 +6051,7 @@ function apply$1(Base) { function shouldWriteAsSeparateStatement() { if (Node.isEnumDeclaration(this) || Node.isModuleDeclaration(this) || Node.isTypeAliasDeclaration(this)) return true; - if (Node.isAmbientableNode(this) && this.isAmbient()) + if (Node.isAmbientable(this) && this.isAmbient()) return true; return false; } @@ -9337,7 +9337,7 @@ function ModuledNode(Base) { const declaration = defaultExportSymbol.getDeclarations()[0]; if (declaration.compilerNode.kind === SyntaxKind.ExportAssignment) removeChildrenWithFormatting({ children: [declaration], getSiblingFormatting: () => FormattingKind.Newline }); - else if (Node.isModifierableNode(declaration)) { + else if (Node.isModifierable(declaration)) { declaration.toggleModifier("default", false); declaration.toggleModifier("export", false); } @@ -9384,7 +9384,7 @@ function getNodeForReferences(node) { const nameNode = node.getNodeProperty("name"); if (nameNode != null) return nameNode; - if (Node.isExportableNode(node)) + if (Node.isExportable(node)) return node.getDefaultKeyword() || node; return node; } @@ -9673,7 +9673,7 @@ function QuestionTokenableNode(Base) { if (value === hasQuestionToken) return this; if (value) { - if (Node.isExclamationTokenableNode(this)) + if (Node.isExclamationTokenable(this)) this.setHasExclamationToken(false); insertIntoParentTextRange({ insertPos: getInsertPos.call(this), @@ -11405,7 +11405,7 @@ function StatementedNode(Base) { } getStructure() { const structure = {}; - if (Node.isBodyableNode(this) && !this.hasBody()) + if (Node.isBodyable(this) && !this.hasBody()) structure.statements = undefined; else { structure.statements = this.getStatements().map(s => { @@ -11417,7 +11417,7 @@ function StatementedNode(Base) { return callBaseGetStructure(Base.prototype, this, structure); } set(structure) { - if (Node.isBodyableNode(this) && structure.statements == null && structure.hasOwnProperty(nameof(structure, "statements"))) + if (Node.isBodyable(this) && structure.statements == null && structure.hasOwnProperty(nameof(structure, "statements"))) this.removeBody(); else if (structure.statements != null) { const statementCount = this._getCompilerStatementsWithComments().length; @@ -11448,7 +11448,7 @@ function StatementedNode(Base) { else return body.compilerNode; } - else if (Node.isBodyableNode(this) || Node.isBodiedNode(this)) + else if (Node.isBodyable(this) || Node.isBodied(this)) return (_a = this.getBody()) === null || _a === void 0 ? void 0 : _a.compilerNode; else if (Node.isBlock(this) || Node.isModuleBlock(this)) return this.compilerNode; @@ -11483,7 +11483,7 @@ function StatementedNode(Base) { }; } function addBodyIfNotExists(node) { - if (Node.isBodyableNode(node) && !node.hasBody()) + if (Node.isBodyable(node) && !node.hasBody()) node.addBody(); } @@ -12951,7 +12951,7 @@ class ModuleDeclaration extends ModuleDeclarationBase { } _getInnerBody() { let node = this.getBody(); - while (node != null && Node.isBodyableNode(node) && node.compilerNode.statements == null) + while (node != null && Node.isBodyable(node) && node.compilerNode.statements == null) node = node.getBody(); return node; } @@ -13988,7 +13988,7 @@ function ClassLikeDeclarationBaseSpecific(Base) { index, parent: this, write: (writer, info) => { - const previousMemberHasBody = !isAmbient && info.previousMember != null && Node.isBodyableNode(info.previousMember) + const previousMemberHasBody = !isAmbient && info.previousMember != null && Node.isBodyable(info.previousMember) && info.previousMember.hasBody(); const firstStructureHasBody = !isAmbient && members instanceof Array && structureHasBody(members[0]); if (previousMemberHasBody || info.previousMember != null && firstStructureHasBody) @@ -14000,7 +14000,7 @@ function ClassLikeDeclarationBaseSpecific(Base) { memberPrinter.printTexts(memberWriter, members); writer.write(memberWriter.toString()); const lastStructureHasBody = !isAmbient && members instanceof Array && structureHasBody(members[members.length - 1]); - const nextMemberHasBody = !isAmbient && info.nextMember != null && Node.isBodyableNode(info.nextMember) && info.nextMember.hasBody(); + const nextMemberHasBody = !isAmbient && info.nextMember != null && Node.isBodyable(info.nextMember) && info.nextMember.hasBody(); if (info.nextMember != null && lastStructureHasBody || nextMemberHasBody) writer.blankLineIfLastNot(); else diff --git a/packages/ts-morph/lib/ts-morph.d.ts b/packages/ts-morph/lib/ts-morph.d.ts index e1f658bf3..602bbce90 100644 --- a/packages/ts-morph/lib/ts-morph.d.ts +++ b/packages/ts-morph/lib/ts-morph.d.ts @@ -3930,17 +3930,17 @@ export declare class Node { * Gets if the node is an AbstractableNode. * @param node - Node to check. */ - static isAbstractableNode(node: T | undefined): node is AbstractableNode & AbstractableNodeExtensionType & T; + static isAbstractable(node: T | undefined): node is AbstractableNode & AbstractableNodeExtensionType & T; /** * Gets if the node is an AmbientableNode. * @param node - Node to check. */ - static isAmbientableNode(node: T | undefined): node is AmbientableNode & AmbientableNodeExtensionType & T; + static isAmbientable(node: T | undefined): node is AmbientableNode & AmbientableNodeExtensionType & T; /** * Gets if the node is an ArgumentedNode. * @param node - Node to check. */ - static isArgumentedNode(node: T | undefined): node is ArgumentedNode & ArgumentedNodeExtensionType & T; + static isArgumented(node: T | undefined): node is ArgumentedNode & ArgumentedNodeExtensionType & T; /** * Gets if the node is an ArrayTypeNode. * @param node - Node to check. @@ -3950,32 +3950,32 @@ export declare class Node { * Gets if the node is an AssertionKeyNamedNode. * @param node - Node to check. */ - static isAssertionKeyNamedNode(node: T | undefined): node is AssertionKeyNamedNode & AssertionKeyNamedNodeExtensionType & T; + static isAssertionKeyNamed(node: T | undefined): node is AssertionKeyNamedNode & AssertionKeyNamedNodeExtensionType & T; /** * Gets if the node is an AsyncableNode. * @param node - Node to check. */ - static isAsyncableNode(node: T | undefined): node is AsyncableNode & AsyncableNodeExtensionType & T; + static isAsyncable(node: T | undefined): node is AsyncableNode & AsyncableNodeExtensionType & T; /** * Gets if the node is an AwaitableNode. * @param node - Node to check. */ - static isAwaitableNode(node: T | undefined): node is AwaitableNode & AwaitableNodeExtensionType & T; + static isAwaitable(node: T | undefined): node is AwaitableNode & AwaitableNodeExtensionType & T; /** * Gets if the node is a BindingNamedNode. * @param node - Node to check. */ - static isBindingNamedNode(node: T | undefined): node is BindingNamedNode & BindingNamedNodeExtensionType & T; + static isBindingNamed(node: T | undefined): node is BindingNamedNode & BindingNamedNodeExtensionType & T; /** * Gets if the node is a BodiedNode. * @param node - Node to check. */ - static isBodiedNode(node: T | undefined): node is BodiedNode & BodiedNodeExtensionType & T; + static isBodied(node: T | undefined): node is BodiedNode & BodiedNodeExtensionType & T; /** * Gets if the node is a BodyableNode. * @param node - Node to check. */ - static isBodyableNode(node: T | undefined): node is BodyableNode & BodyableNodeExtensionType & T; + static isBodyable(node: T | undefined): node is BodyableNode & BodyableNodeExtensionType & T; /** * Gets if the node is a CallSignatureDeclaration. * @param node - Node to check. @@ -3985,7 +3985,7 @@ export declare class Node { * Gets if the node is a ChildOrderableNode. * @param node - Node to check. */ - static isChildOrderableNode(node: T | undefined): node is ChildOrderableNode & ChildOrderableNodeExtensionType & T; + static isChildOrderable(node: T | undefined): node is ChildOrderableNode & ChildOrderableNodeExtensionType & T; /** * Gets if the node is a ClassLikeDeclarationBase. * @param node - Node to check. @@ -4015,27 +4015,27 @@ export declare class Node { * Gets if the node is a DecoratableNode. * @param node - Node to check. */ - static isDecoratableNode(node: T | undefined): node is DecoratableNode & DecoratableNodeExtensionType & T; + static isDecoratable(node: T | undefined): node is DecoratableNode & DecoratableNodeExtensionType & T; /** * Gets if the node is a DotDotDotTokenableNode. * @param node - Node to check. */ - static isDotDotDotTokenableNode(node: T | undefined): node is DotDotDotTokenableNode & DotDotDotTokenableNodeExtensionType & T; + static isDotDotDotTokenable(node: T | undefined): node is DotDotDotTokenableNode & DotDotDotTokenableNodeExtensionType & T; /** * Gets if the node is an ExclamationTokenableNode. * @param node - Node to check. */ - static isExclamationTokenableNode(node: T | undefined): node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType & T; + static isExclamationTokenable(node: T | undefined): node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType & T; /** * Gets if the node is an ExportableNode. * @param node - Node to check. */ - static isExportableNode(node: T | undefined): node is ExportableNode & ExportableNodeExtensionType & T; + static isExportable(node: T | undefined): node is ExportableNode & ExportableNodeExtensionType & T; /** * Gets if the node is an ExportGetableNode. * @param node - Node to check. */ - static isExportGetableNode(node: T | undefined): node is ExportGetableNode & ExportGetableNodeExtensionType & T; + static isExportGetable(node: T | undefined): node is ExportGetableNode & ExportGetableNodeExtensionType & T; /** * Gets if the node is an Expression. * @param node - Node to check. @@ -4045,17 +4045,17 @@ export declare class Node { * Gets if the node is an ExpressionableNode. * @param node - Node to check. */ - static isExpressionableNode(node: T | undefined): node is ExpressionableNode & ExpressionableNodeExtensionType & T; + static isExpressionable(node: T | undefined): node is ExpressionableNode & ExpressionableNodeExtensionType & T; /** * Gets if the node is an ExpressionedNode. * @param node - Node to check. */ - static isExpressionedNode(node: T | undefined): node is ExpressionedNode & ExpressionedNodeExtensionType & T; + static isExpressioned(node: T | undefined): node is ExpressionedNode & ExpressionedNodeExtensionType & T; /** * Gets if the node is an ExtendsClauseableNode. * @param node - Node to check. */ - static isExtendsClauseableNode(node: T | undefined): node is ExtendsClauseableNode & ExtendsClauseableNodeExtensionType & T; + static isExtendsClauseable(node: T | undefined): node is ExtendsClauseableNode & ExtendsClauseableNodeExtensionType & T; /** * Gets if the node is a FalseLiteral. * @param node - Node to check. @@ -4075,7 +4075,7 @@ export declare class Node { * Gets if the node is a GeneratorableNode. * @param node - Node to check. */ - static isGeneratorableNode(node: T | undefined): node is GeneratorableNode & GeneratorableNodeExtensionType & T; + static isGeneratorable(node: T | undefined): node is GeneratorableNode & GeneratorableNodeExtensionType & T; /** * Gets if the node is a GetAccessorDeclaration. * @param node - Node to check. @@ -4085,12 +4085,12 @@ export declare class Node { * Gets if the node is a HeritageClauseableNode. * @param node - Node to check. */ - static isHeritageClauseableNode(node: T | undefined): node is HeritageClauseableNode & HeritageClauseableNodeExtensionType & T; + static isHeritageClauseable(node: T | undefined): node is HeritageClauseableNode & HeritageClauseableNodeExtensionType & T; /** * Gets if the node is a ImplementsClauseableNode. * @param node - Node to check. */ - static isImplementsClauseableNode(node: T | undefined): node is ImplementsClauseableNode & ImplementsClauseableNodeExtensionType & T; + static isImplementsClauseable(node: T | undefined): node is ImplementsClauseableNode & ImplementsClauseableNodeExtensionType & T; /** * Gets if the node is a ImportExpression. * @param node - Node to check. @@ -4120,12 +4120,12 @@ export declare class Node { * Gets if the node is a InitializerExpressionableNode. * @param node - Node to check. */ - static isInitializerExpressionableNode(node: T | undefined): node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType & T; + static isInitializerExpressionable(node: T | undefined): node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType & T; /** * Gets if the node is a InitializerExpressionGetableNode. * @param node - Node to check. */ - static isInitializerExpressionGetableNode(node: T | undefined): node is InitializerExpressionGetableNode & InitializerExpressionGetableNodeExtensionType & T; + static isInitializerExpressionGetable(node: T | undefined): node is InitializerExpressionGetableNode & InitializerExpressionGetableNodeExtensionType & T; /** * Gets if the node is a IntersectionTypeNode. * @param node - Node to check. @@ -4145,7 +4145,7 @@ export declare class Node { * Gets if the node is a JSDocableNode. * @param node - Node to check. */ - static isJSDocableNode(node: T | undefined): node is JSDocableNode & JSDocableNodeExtensionType & T; + static isJSDocable(node: T | undefined): node is JSDocableNode & JSDocableNodeExtensionType & T; /** * Gets if the node is a JSDocPropertyLikeTag. * @param node - Node to check. @@ -4180,12 +4180,12 @@ export declare class Node { * Gets if the node is a JsxAttributedNode. * @param node - Node to check. */ - static isJsxAttributedNode(node: T | undefined): node is JsxAttributedNode & JsxAttributedNodeExtensionType & T; + static isJsxAttributed(node: T | undefined): node is JsxAttributedNode & JsxAttributedNodeExtensionType & T; /** * Gets if the node is a JsxTagNamedNode. * @param node - Node to check. */ - static isJsxTagNamedNode(node: T | undefined): node is JsxTagNamedNode & JsxTagNamedNodeExtensionType & T; + static isJsxTagNamed(node: T | undefined): node is JsxTagNamedNode & JsxTagNamedNodeExtensionType & T; /** * Gets if the node is a LeftHandSideExpression. * @param node - Node to check. @@ -4195,7 +4195,7 @@ export declare class Node { * Gets if the node is a LeftHandSideExpressionedNode. * @param node - Node to check. */ - static isLeftHandSideExpressionedNode(node: T | undefined): node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType & T; + static isLeftHandSideExpressioned(node: T | undefined): node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType & T; /** * Gets if the node is a LiteralExpression. * @param node - Node to check. @@ -4205,7 +4205,7 @@ export declare class Node { * Gets if the node is a LiteralLikeNode. * @param node - Node to check. */ - static isLiteralLikeNode(node: T | undefined): node is LiteralLikeNode & LiteralLikeNodeExtensionType & T; + static isLiteralLike(node: T | undefined): node is LiteralLikeNode & LiteralLikeNodeExtensionType & T; /** * Gets if the node is a LiteralTypeNode. * @param node - Node to check. @@ -4225,32 +4225,32 @@ export declare class Node { * Gets if the node is a ModifierableNode. * @param node - Node to check. */ - static isModifierableNode(node: T | undefined): node is ModifierableNode & ModifierableNodeExtensionType & T; + static isModifierable(node: T | undefined): node is ModifierableNode & ModifierableNodeExtensionType & T; /** * Gets if the node is a ModuleChildableNode. * @param node - Node to check. */ - static isModuleChildableNode(node: T | undefined): node is ModuleChildableNode & ModuleChildableNodeExtensionType & T; + static isModuleChildable(node: T | undefined): node is ModuleChildableNode & ModuleChildableNodeExtensionType & T; /** * Gets if the node is a ModuledNode. * @param node - Node to check. */ - static isModuledNode(node: T | undefined): node is ModuledNode & ModuledNodeExtensionType & T; + static isModuled(node: T | undefined): node is ModuledNode & ModuledNodeExtensionType & T; /** * Gets if the node is a ModuleNamedNode. * @param node - Node to check. */ - static isModuleNamedNode(node: T | undefined): node is ModuleNamedNode & ModuleNamedNodeExtensionType & T; + static isModuleNamed(node: T | undefined): node is ModuleNamedNode & ModuleNamedNodeExtensionType & T; /** * Gets if the node is a NameableNode. * @param node - Node to check. */ - static isNameableNode(node: T | undefined): node is NameableNode & NameableNodeExtensionType & T; + static isNameable(node: T | undefined): node is NameableNode & NameableNodeExtensionType & T; /** * Gets if the node is a NamedNode. * @param node - Node to check. */ - static isNamedNode(node: T | undefined): node is NamedNode & NamedNodeExtensionType & T; + static isNamed(node: T | undefined): node is NamedNode & NamedNodeExtensionType & T; /** * Gets if the node is a NullLiteral. * @param node - Node to check. @@ -4260,12 +4260,12 @@ export declare class Node { * Gets if the node is a OverloadableNode. * @param node - Node to check. */ - static isOverloadableNode(node: T | undefined): node is OverloadableNode & OverloadableNodeExtensionType & T; + static isOverloadable(node: T | undefined): node is OverloadableNode & OverloadableNodeExtensionType & T; /** * Gets if the node is a OverrideableNode. * @param node - Node to check. */ - static isOverrideableNode(node: T | undefined): node is OverrideableNode & OverrideableNodeExtensionType & T; + static isOverrideable(node: T | undefined): node is OverrideableNode & OverrideableNodeExtensionType & T; /** * Gets if the node is a ParameterDeclaration. * @param node - Node to check. @@ -4275,7 +4275,7 @@ export declare class Node { * Gets if the node is a ParameteredNode. * @param node - Node to check. */ - static isParameteredNode(node: T | undefined): node is ParameteredNode & ParameteredNodeExtensionType & T; + static isParametered(node: T | undefined): node is ParameteredNode & ParameteredNodeExtensionType & T; /** * Gets if the node is a ParenthesizedTypeNode. * @param node - Node to check. @@ -4290,47 +4290,47 @@ export declare class Node { * Gets if the node is a PropertyNamedNode. * @param node - Node to check. */ - static isPropertyNamedNode(node: T | undefined): node is PropertyNamedNode & PropertyNamedNodeExtensionType & T; + static isPropertyNamed(node: T | undefined): node is PropertyNamedNode & PropertyNamedNodeExtensionType & T; /** * Gets if the node is a QuestionDotTokenableNode. * @param node - Node to check. */ - static isQuestionDotTokenableNode(node: T | undefined): node is QuestionDotTokenableNode & QuestionDotTokenableNodeExtensionType & T; + static isQuestionDotTokenable(node: T | undefined): node is QuestionDotTokenableNode & QuestionDotTokenableNodeExtensionType & T; /** * Gets if the node is a QuestionTokenableNode. * @param node - Node to check. */ - static isQuestionTokenableNode(node: T | undefined): node is QuestionTokenableNode & QuestionTokenableNodeExtensionType & T; + static isQuestionTokenable(node: T | undefined): node is QuestionTokenableNode & QuestionTokenableNodeExtensionType & T; /** * Gets if the node is a ReadonlyableNode. * @param node - Node to check. */ - static isReadonlyableNode(node: T | undefined): node is ReadonlyableNode & ReadonlyableNodeExtensionType & T; + static isReadonlyable(node: T | undefined): node is ReadonlyableNode & ReadonlyableNodeExtensionType & T; /** * Gets if the node is a ReferenceFindableNode. * @param node - Node to check. */ - static isReferenceFindableNode(node: T | undefined): node is ReferenceFindableNode & ReferenceFindableNodeExtensionType & T; + static isReferenceFindable(node: T | undefined): node is ReferenceFindableNode & ReferenceFindableNodeExtensionType & T; /** * Gets if the node is a RenameableNode. * @param node - Node to check. */ - static isRenameableNode(node: T | undefined): node is RenameableNode & RenameableNodeExtensionType & T; + static isRenameable(node: T | undefined): node is RenameableNode & RenameableNodeExtensionType & T; /** * Gets if the node is a ReturnTypedNode. * @param node - Node to check. */ - static isReturnTypedNode(node: T | undefined): node is ReturnTypedNode & ReturnTypedNodeExtensionType & T; + static isReturnTyped(node: T | undefined): node is ReturnTypedNode & ReturnTypedNodeExtensionType & T; /** * Gets if the node is a ScopeableNode. * @param node - Node to check. */ - static isScopeableNode(node: T | undefined): node is ScopeableNode & ScopeableNodeExtensionType & T; + static isScopeable(node: T | undefined): node is ScopeableNode & ScopeableNodeExtensionType & T; /** * Gets if the node is a ScopedNode. * @param node - Node to check. */ - static isScopedNode(node: T | undefined): node is ScopedNode & ScopedNodeExtensionType & T; + static isScoped(node: T | undefined): node is ScopedNode & ScopedNodeExtensionType & T; /** * Gets if the node is a SetAccessorDeclaration. * @param node - Node to check. @@ -4350,12 +4350,12 @@ export declare class Node { * Gets if the node is a StatementedNode. * @param node - Node to check. */ - static isStatementedNode(node: T | undefined): node is StatementedNode & StatementedNodeExtensionType & T; + static isStatemented(node: T | undefined): node is StatementedNode & StatementedNodeExtensionType & T; /** * Gets if the node is a StaticableNode. * @param node - Node to check. */ - static isStaticableNode(node: T | undefined): node is StaticableNode & StaticableNodeExtensionType & T; + static isStaticable(node: T | undefined): node is StaticableNode & StaticableNodeExtensionType & T; /** * Gets if the node is a SuperExpression. * @param node - Node to check. @@ -4370,7 +4370,7 @@ export declare class Node { * Gets if the node is a TextInsertableNode. * @param node - Node to check. */ - static isTextInsertableNode(node: T | undefined): node is TextInsertableNode & TextInsertableNodeExtensionType & T; + static isTextInsertable(node: T | undefined): node is TextInsertableNode & TextInsertableNodeExtensionType & T; /** * Gets if the node is a ThisExpression. * @param node - Node to check. @@ -4395,7 +4395,7 @@ export declare class Node { * Gets if the node is a TypeArgumentedNode. * @param node - Node to check. */ - static isTypeArgumentedNode(node: T | undefined): node is TypeArgumentedNode & TypeArgumentedNodeExtensionType & T; + static isTypeArgumented(node: T | undefined): node is TypeArgumentedNode & TypeArgumentedNodeExtensionType & T; /** * Gets if the node is a TypeAssertion. * @param node - Node to check. @@ -4405,7 +4405,7 @@ export declare class Node { * Gets if the node is a TypedNode. * @param node - Node to check. */ - static isTypedNode(node: T | undefined): node is TypedNode & TypedNodeExtensionType & T; + static isTyped(node: T | undefined): node is TypedNode & TypedNodeExtensionType & T; /** * Gets if the node is a TypeElement. * @param node - Node to check. @@ -4415,12 +4415,12 @@ export declare class Node { * Gets if the node is a TypeElementMemberedNode. * @param node - Node to check. */ - static isTypeElementMemberedNode(node: T | undefined): node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType & T; + static isTypeElementMembered(node: T | undefined): node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType & T; /** * Gets if the node is a TypeLiteralNode. * @param node - Node to check. */ - static isTypeLiteralNode(node: Node | undefined): node is TypeLiteralNode; + static isTypeLiteral(node: Node | undefined): node is TypeLiteralNode; /** * Gets if the node is a TypeNode. * @param node - Node to check. @@ -4440,22 +4440,22 @@ export declare class Node { * Gets if the node is a TypeParameteredNode. * @param node - Node to check. */ - static isTypeParameteredNode(node: T | undefined): node is TypeParameteredNode & TypeParameteredNodeExtensionType & T; + static isTypeParametered(node: T | undefined): node is TypeParameteredNode & TypeParameteredNodeExtensionType & T; /** * Gets if the node is a TypePredicateNode. * @param node - Node to check. */ - static isTypePredicateNode(node: Node | undefined): node is TypePredicateNode; + static isTypePredicate(node: Node | undefined): node is TypePredicateNode; /** * Gets if the node is a TypeQueryNode. * @param node - Node to check. */ - static isTypeQueryNode(node: Node | undefined): node is TypeQueryNode; + static isTypeQuery(node: Node | undefined): node is TypeQueryNode; /** * Gets if the node is a TypeReferenceNode. * @param node - Node to check. */ - static isTypeReferenceNode(node: Node | undefined): node is TypeReferenceNode; + static isTypeReference(node: Node | undefined): node is TypeReferenceNode; /** * Gets if the node is a UnaryExpression. * @param node - Node to check. @@ -4465,7 +4465,7 @@ export declare class Node { * Gets if the node is a UnaryExpressionedNode. * @param node - Node to check. */ - static isUnaryExpressionedNode(node: T | undefined): node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType & T; + static isUnaryExpressioned(node: T | undefined): node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType & T; /** * Gets if the node is a UnionTypeNode. * @param node - Node to check. @@ -4475,7 +4475,7 @@ export declare class Node { * Gets if the node is a UnwrappableNode. * @param node - Node to check. */ - static isUnwrappableNode(node: T | undefined): node is UnwrappableNode & UnwrappableNodeExtensionType & T; + static isUnwrappable(node: T | undefined): node is UnwrappableNode & UnwrappableNodeExtensionType & T; /** * Gets if the node is a UpdateExpression. * @param node - Node to check. diff --git a/packages/ts-morph/scripts/generation/createNodeTypeGuards.ts b/packages/ts-morph/scripts/generation/createNodeTypeGuards.ts index 3391c969e..a217be13a 100644 --- a/packages/ts-morph/scripts/generation/createNodeTypeGuards.ts +++ b/packages/ts-morph/scripts/generation/createNodeTypeGuards.ts @@ -43,7 +43,7 @@ export function createNodeTypeGuards(inspector: TsMorphInspector, tsInspector: T getMethodInfos().filter(n => isAllowedClass(n.name.replace(/^is/, ""))).forEach(method => { const description = `Gets if the node is ${(method.name[0] === "A" || method.name[0] === "E") ? "an" : "a"} ${method.name}.`; const common = { - name: `is${method.name}`, + name: `is${method.name.endsWith("TypeNode") ? method.name : method.name.replace(/Node$/, "")}`, isStatic: true, }; const isImplementedNodeName = implementedNodeNames.has(method.name); diff --git a/packages/ts-morph/src/compiler/ast/base/ExclamationTokenableNode.ts b/packages/ts-morph/src/compiler/ast/base/ExclamationTokenableNode.ts index 5232ac9d6..50e0de24e 100644 --- a/packages/ts-morph/src/compiler/ast/base/ExclamationTokenableNode.ts +++ b/packages/ts-morph/src/compiler/ast/base/ExclamationTokenableNode.ts @@ -50,7 +50,7 @@ export function ExclamationTokenableNode>(Bas const declaration = defaultExportSymbol.getDeclarations()[0]; if (declaration.compilerNode.kind === SyntaxKind.ExportAssignment) removeChildrenWithFormatting({ children: [declaration], getSiblingFormatting: () => FormattingKind.Newline }); - else if (Node.isModifierableNode(declaration)) { + else if (Node.isModifierable(declaration)) { declaration.toggleModifier("default", false); declaration.toggleModifier("export", false); } diff --git a/packages/ts-morph/src/compiler/ast/base/QuestionTokenableNode.ts b/packages/ts-morph/src/compiler/ast/base/QuestionTokenableNode.ts index 32a72b530..3c210667b 100644 --- a/packages/ts-morph/src/compiler/ast/base/QuestionTokenableNode.ts +++ b/packages/ts-morph/src/compiler/ast/base/QuestionTokenableNode.ts @@ -50,7 +50,7 @@ export function QuestionTokenableNode { - const previousMemberHasBody = !isAmbient && info.previousMember != null && Node.isBodyableNode(info.previousMember) + const previousMemberHasBody = !isAmbient && info.previousMember != null && Node.isBodyable(info.previousMember) && info.previousMember.hasBody(); const firstStructureHasBody = !isAmbient && members instanceof Array && structureHasBody(members[0]); @@ -693,7 +693,7 @@ export function ClassLikeDeclarationBaseSpecific { */ getChildSyntaxList(): SyntaxList | undefined { let node: Node = this; - if (Node.isBodyableNode(node) || Node.isBodiedNode(node)) { + if (Node.isBodyable(node) || Node.isBodied(node)) { do { - const bodyNode = Node.isBodyableNode(node) ? node.getBody() : node.getBody(); + const bodyNode = Node.isBodyable(node) ? node.getBody() : node.getBody(); if (bodyNode == null) return undefined; node = bodyNode; - } while ((Node.isBodyableNode(node) || Node.isBodiedNode(node)) && (node.compilerNode as ts.Block).statements == null); + } while ((Node.isBodyable(node) || Node.isBodied(node)) && (node.compilerNode as ts.Block).statements == null); } if (Node.isSourceFile(node) - || Node.isBodyableNode(this) - || Node.isBodiedNode(this) + || Node.isBodyable(this) + || Node.isBodied(this) || Node.isCaseBlock(this) || Node.isCaseClause(this) || Node.isDefaultClause(this) @@ -2176,7 +2176,7 @@ export class Node { * Gets if the node is an AbstractableNode. * @param node - Node to check. */ - static isAbstractableNode(node: T | undefined): node is compiler.AbstractableNode & compiler.AbstractableNodeExtensionType & T { + static isAbstractable(node: T | undefined): node is compiler.AbstractableNode & compiler.AbstractableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -2195,7 +2195,7 @@ export class Node { * Gets if the node is an AmbientableNode. * @param node - Node to check. */ - static isAmbientableNode(node: T | undefined): node is compiler.AmbientableNode & compiler.AmbientableNodeExtensionType & T { + static isAmbientable(node: T | undefined): node is compiler.AmbientableNode & compiler.AmbientableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -2218,7 +2218,7 @@ export class Node { * Gets if the node is an ArgumentedNode. * @param node - Node to check. */ - static isArgumentedNode(node: T | undefined): node is compiler.ArgumentedNode & compiler.ArgumentedNodeExtensionType & T { + static isArgumented(node: T | undefined): node is compiler.ArgumentedNode & compiler.ArgumentedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: @@ -2254,7 +2254,7 @@ export class Node { * Gets if the node is an AssertionKeyNamedNode. * @param node - Node to check. */ - static isAssertionKeyNamedNode(node: T | undefined): node is compiler.AssertionKeyNamedNode & compiler.AssertionKeyNamedNodeExtensionType & T { + static isAssertionKeyNamed(node: T | undefined): node is compiler.AssertionKeyNamedNode & compiler.AssertionKeyNamedNodeExtensionType & T { return node?.getKind() === SyntaxKind.AssertEntry; } @@ -2262,7 +2262,7 @@ export class Node { * Gets if the node is an AsyncableNode. * @param node - Node to check. */ - static isAsyncableNode(node: T | undefined): node is compiler.AsyncableNode & compiler.AsyncableNodeExtensionType & T { + static isAsyncable(node: T | undefined): node is compiler.AsyncableNode & compiler.AsyncableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.FunctionDeclaration: @@ -2278,7 +2278,7 @@ export class Node { * Gets if the node is an AwaitableNode. * @param node - Node to check. */ - static isAwaitableNode(node: T | undefined): node is compiler.AwaitableNode & compiler.AwaitableNodeExtensionType & T { + static isAwaitable(node: T | undefined): node is compiler.AwaitableNode & compiler.AwaitableNodeExtensionType & T { return node?.getKind() === SyntaxKind.ForOfStatement; } @@ -2295,7 +2295,7 @@ export class Node { * Gets if the node is a BindingNamedNode. * @param node - Node to check. */ - static isBindingNamedNode(node: T | undefined): node is compiler.BindingNamedNode & compiler.BindingNamedNodeExtensionType & T { + static isBindingNamed(node: T | undefined): node is compiler.BindingNamedNode & compiler.BindingNamedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.Parameter: @@ -2313,7 +2313,7 @@ export class Node { * Gets if the node is a BodiedNode. * @param node - Node to check. */ - static isBodiedNode(node: T | undefined): node is compiler.BodiedNode & compiler.BodiedNodeExtensionType & T { + static isBodied(node: T | undefined): node is compiler.BodiedNode & compiler.BodiedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.ClassStaticBlockDeclaration: @@ -2328,7 +2328,7 @@ export class Node { * Gets if the node is a BodyableNode. * @param node - Node to check. */ - static isBodyableNode(node: T | undefined): node is compiler.BodyableNode & compiler.BodyableNodeExtensionType & T { + static isBodyable(node: T | undefined): node is compiler.BodyableNode & compiler.BodyableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: @@ -2368,7 +2368,7 @@ export class Node { * Gets if the node is a ChildOrderableNode. * @param node - Node to check. */ - static isChildOrderableNode(node: T | undefined): node is compiler.ChildOrderableNode & compiler.ChildOrderableNodeExtensionType & T { + static isChildOrderable(node: T | undefined): node is compiler.ChildOrderableNode & compiler.ChildOrderableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.Block: case SyntaxKind.BreakStatement: @@ -2487,7 +2487,7 @@ export class Node { * Gets if the node is a DecoratableNode. * @param node - Node to check. */ - static isDecoratableNode(node: T | undefined): node is compiler.DecoratableNode & compiler.DecoratableNodeExtensionType & T { + static isDecoratable(node: T | undefined): node is compiler.DecoratableNode & compiler.DecoratableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -2515,7 +2515,7 @@ export class Node { * Gets if the node is a DotDotDotTokenableNode. * @param node - Node to check. */ - static isDotDotDotTokenableNode(node: T | undefined): node is compiler.DotDotDotTokenableNode & compiler.DotDotDotTokenableNodeExtensionType & T { + static isDotDotDotTokenable(node: T | undefined): node is compiler.DotDotDotTokenableNode & compiler.DotDotDotTokenableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.JsxExpression: @@ -2540,7 +2540,7 @@ export class Node { * Gets if the node is an ExclamationTokenableNode. * @param node - Node to check. */ - static isExclamationTokenableNode(node: T | undefined): node is compiler.ExclamationTokenableNode & compiler.ExclamationTokenableNodeExtensionType & T { + static isExclamationTokenable(node: T | undefined): node is compiler.ExclamationTokenableNode & compiler.ExclamationTokenableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.PropertyDeclaration: case SyntaxKind.VariableDeclaration: @@ -2554,7 +2554,7 @@ export class Node { * Gets if the node is an ExportableNode. * @param node - Node to check. */ - static isExportableNode(node: T | undefined): node is compiler.ExportableNode & compiler.ExportableNodeExtensionType & T { + static isExportable(node: T | undefined): node is compiler.ExportableNode & compiler.ExportableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -2578,7 +2578,7 @@ export class Node { * Gets if the node is an ExportGetableNode. * @param node - Node to check. */ - static isExportGetableNode(node: T | undefined): node is compiler.ExportGetableNode & compiler.ExportGetableNodeExtensionType & T { + static isExportGetable(node: T | undefined): node is compiler.ExportGetableNode & compiler.ExportGetableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -2668,7 +2668,7 @@ export class Node { * Gets if the node is an ExpressionableNode. * @param node - Node to check. */ - static isExpressionableNode(node: T | undefined): node is compiler.ExpressionableNode & compiler.ExpressionableNodeExtensionType & T { + static isExpressionable(node: T | undefined): node is compiler.ExpressionableNode & compiler.ExpressionableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ExternalModuleReference: case SyntaxKind.JsxExpression: @@ -2684,7 +2684,7 @@ export class Node { * Gets if the node is an ExpressionedNode. * @param node - Node to check. */ - static isExpressionedNode(node: T | undefined): node is compiler.ExpressionedNode & compiler.ExpressionedNodeExtensionType & T { + static isExpressioned(node: T | undefined): node is compiler.ExpressionedNode & compiler.ExpressionedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.AsExpression: case SyntaxKind.CaseClause: @@ -2721,7 +2721,7 @@ export class Node { * Gets if the node is an ExtendsClauseableNode. * @param node - Node to check. */ - static isExtendsClauseableNode(node: T | undefined): node is compiler.ExtendsClauseableNode & compiler.ExtendsClauseableNodeExtensionType & T { + static isExtendsClauseable(node: T | undefined): node is compiler.ExtendsClauseableNode & compiler.ExtendsClauseableNodeExtensionType & T { return node?.getKind() === SyntaxKind.InterfaceDeclaration; } @@ -2777,7 +2777,7 @@ export class Node { * Gets if the node is a GeneratorableNode. * @param node - Node to check. */ - static isGeneratorableNode(node: T | undefined): node is compiler.GeneratorableNode & compiler.GeneratorableNodeExtensionType & T { + static isGeneratorable(node: T | undefined): node is compiler.GeneratorableNode & compiler.GeneratorableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: @@ -2804,7 +2804,7 @@ export class Node { * Gets if the node is a HeritageClauseableNode. * @param node - Node to check. */ - static isHeritageClauseableNode(node: T | undefined): node is compiler.HeritageClauseableNode & compiler.HeritageClauseableNodeExtensionType & T { + static isHeritageClauseable(node: T | undefined): node is compiler.HeritageClauseableNode & compiler.HeritageClauseableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -2824,7 +2824,7 @@ export class Node { * Gets if the node is a ImplementsClauseableNode. * @param node - Node to check. */ - static isImplementsClauseableNode(node: T | undefined): node is compiler.ImplementsClauseableNode & compiler.ImplementsClauseableNodeExtensionType & T { + static isImplementsClauseable(node: T | undefined): node is compiler.ImplementsClauseableNode & compiler.ImplementsClauseableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -2891,7 +2891,7 @@ export class Node { * Gets if the node is a InitializerExpressionableNode. * @param node - Node to check. */ - static isInitializerExpressionableNode(node: T | undefined): node is compiler.InitializerExpressionableNode & compiler.InitializerExpressionableNodeExtensionType & T { + static isInitializerExpressionable(node: T | undefined): node is compiler.InitializerExpressionableNode & compiler.InitializerExpressionableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.EnumMember: @@ -2909,7 +2909,7 @@ export class Node { * Gets if the node is a InitializerExpressionGetableNode. * @param node - Node to check. */ - static isInitializerExpressionGetableNode(node: T | undefined): node is compiler.InitializerExpressionGetableNode & compiler.InitializerExpressionGetableNodeExtensionType & T { + static isInitializerExpressionGetable(node: T | undefined): node is compiler.InitializerExpressionGetableNode & compiler.InitializerExpressionGetableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.BindingElement: case SyntaxKind.EnumMember: @@ -2965,7 +2965,7 @@ export class Node { * Gets if the node is a JSDocableNode. * @param node - Node to check. */ - static isJSDocableNode(node: T | undefined): node is compiler.JSDocableNode & compiler.JSDocableNodeExtensionType & T { + static isJSDocable(node: T | undefined): node is compiler.JSDocableNode & compiler.JSDocableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -3186,7 +3186,7 @@ export class Node { * Gets if the node is a JsxAttributedNode. * @param node - Node to check. */ - static isJsxAttributedNode(node: T | undefined): node is compiler.JsxAttributedNode & compiler.JsxAttributedNodeExtensionType & T { + static isJsxAttributed(node: T | undefined): node is compiler.JsxAttributedNode & compiler.JsxAttributedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxSelfClosingElement: @@ -3219,7 +3219,7 @@ export class Node { * Gets if the node is a JsxTagNamedNode. * @param node - Node to check. */ - static isJsxTagNamedNode(node: T | undefined): node is compiler.JsxTagNamedNode & compiler.JsxTagNamedNodeExtensionType & T { + static isJsxTagNamed(node: T | undefined): node is compiler.JsxTagNamedNode & compiler.JsxTagNamedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.JsxClosingElement: case SyntaxKind.JsxOpeningElement: @@ -3278,7 +3278,7 @@ export class Node { * Gets if the node is a LeftHandSideExpressionedNode. * @param node - Node to check. */ - static isLeftHandSideExpressionedNode(node: T | undefined): node is compiler.LeftHandSideExpressionedNode & compiler.LeftHandSideExpressionedNodeExtensionType & T { + static isLeftHandSideExpressioned(node: T | undefined): node is compiler.LeftHandSideExpressionedNode & compiler.LeftHandSideExpressionedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.Decorator: @@ -3313,7 +3313,7 @@ export class Node { * Gets if the node is a LiteralLikeNode. * @param node - Node to check. */ - static isLiteralLikeNode(node: T | undefined): node is compiler.LiteralLikeNode & compiler.LiteralLikeNodeExtensionType & T { + static isLiteralLike(node: T | undefined): node is compiler.LiteralLikeNode & compiler.LiteralLikeNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.BigIntLiteral: case SyntaxKind.JsxText: @@ -3394,7 +3394,7 @@ export class Node { * Gets if the node is a ModifierableNode. * @param node - Node to check. */ - static isModifierableNode(node: T | undefined): node is compiler.ModifierableNode & compiler.ModifierableNodeExtensionType & T { + static isModifierable(node: T | undefined): node is compiler.ModifierableNode & compiler.ModifierableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.ClassDeclaration: @@ -3429,7 +3429,7 @@ export class Node { * Gets if the node is a ModuleChildableNode. * @param node - Node to check. */ - static isModuleChildableNode(node: T | undefined): node is compiler.ModuleChildableNode & compiler.ModuleChildableNodeExtensionType & T { + static isModuleChildable(node: T | undefined): node is compiler.ModuleChildableNode & compiler.ModuleChildableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: @@ -3450,7 +3450,7 @@ export class Node { * Gets if the node is a ModuledNode. * @param node - Node to check. */ - static isModuledNode(node: T | undefined): node is compiler.ModuledNode & compiler.ModuledNodeExtensionType & T { + static isModuled(node: T | undefined): node is compiler.ModuledNode & compiler.ModuledNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.SourceFile: @@ -3464,7 +3464,7 @@ export class Node { * Gets if the node is a ModuleNamedNode. * @param node - Node to check. */ - static isModuleNamedNode(node: T | undefined): node is compiler.ModuleNamedNode & compiler.ModuleNamedNodeExtensionType & T { + static isModuleNamed(node: T | undefined): node is compiler.ModuleNamedNode & compiler.ModuleNamedNodeExtensionType & T { return node?.getKind() === SyntaxKind.ModuleDeclaration; } @@ -3472,7 +3472,7 @@ export class Node { * Gets if the node is a NameableNode. * @param node - Node to check. */ - static isNameableNode(node: T | undefined): node is compiler.NameableNode & compiler.NameableNodeExtensionType & T { + static isNameable(node: T | undefined): node is compiler.NameableNode & compiler.NameableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: @@ -3493,7 +3493,7 @@ export class Node { * Gets if the node is a NamedNode. * @param node - Node to check. */ - static isNamedNode(node: T | undefined): node is compiler.NamedNode & compiler.NamedNodeExtensionType & T { + static isNamed(node: T | undefined): node is compiler.NamedNode & compiler.NamedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportEqualsDeclaration: @@ -3553,7 +3553,7 @@ export class Node { * Gets if the node is a OverloadableNode. * @param node - Node to check. */ - static isOverloadableNode(node: T | undefined): node is compiler.OverloadableNode & compiler.OverloadableNodeExtensionType & T { + static isOverloadable(node: T | undefined): node is compiler.OverloadableNode & compiler.OverloadableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: @@ -3568,7 +3568,7 @@ export class Node { * Gets if the node is a OverrideableNode. * @param node - Node to check. */ - static isOverrideableNode(node: T | undefined): node is compiler.OverrideableNode & compiler.OverrideableNodeExtensionType & T { + static isOverrideable(node: T | undefined): node is compiler.OverrideableNode & compiler.OverrideableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.MethodDeclaration: case SyntaxKind.Parameter: @@ -3591,7 +3591,7 @@ export class Node { * Gets if the node is a ParameteredNode. * @param node - Node to check. */ - static isParameteredNode(node: T | undefined): node is compiler.ParameteredNode & compiler.ParameteredNodeExtensionType & T { + static isParametered(node: T | undefined): node is compiler.ParameteredNode & compiler.ParameteredNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -3677,7 +3677,7 @@ export class Node { * Gets if the node is a PropertyNamedNode. * @param node - Node to check. */ - static isPropertyNamedNode(node: T | undefined): node is compiler.PropertyNamedNode & compiler.PropertyNamedNodeExtensionType & T { + static isPropertyNamed(node: T | undefined): node is compiler.PropertyNamedNode & compiler.PropertyNamedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.EnumMember: case SyntaxKind.GetAccessor: @@ -3702,7 +3702,7 @@ export class Node { * Gets if the node is a QuestionDotTokenableNode. * @param node - Node to check. */ - static isQuestionDotTokenableNode(node: T | undefined): node is compiler.QuestionDotTokenableNode & compiler.QuestionDotTokenableNodeExtensionType & T { + static isQuestionDotTokenable(node: T | undefined): node is compiler.QuestionDotTokenableNode & compiler.QuestionDotTokenableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.ElementAccessExpression: @@ -3717,7 +3717,7 @@ export class Node { * Gets if the node is a QuestionTokenableNode. * @param node - Node to check. */ - static isQuestionTokenableNode(node: T | undefined): node is compiler.QuestionTokenableNode & compiler.QuestionTokenableNodeExtensionType & T { + static isQuestionTokenable(node: T | undefined): node is compiler.QuestionTokenableNode & compiler.QuestionTokenableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: @@ -3737,7 +3737,7 @@ export class Node { * Gets if the node is a ReadonlyableNode. * @param node - Node to check. */ - static isReadonlyableNode(node: T | undefined): node is compiler.ReadonlyableNode & compiler.ReadonlyableNodeExtensionType & T { + static isReadonlyable(node: T | undefined): node is compiler.ReadonlyableNode & compiler.ReadonlyableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.IndexSignature: case SyntaxKind.Parameter: @@ -3753,7 +3753,7 @@ export class Node { * Gets if the node is a ReferenceFindableNode. * @param node - Node to check. */ - static isReferenceFindableNode(node: T | undefined): node is compiler.ReferenceFindableNode & compiler.ReferenceFindableNodeExtensionType & T { + static isReferenceFindable(node: T | undefined): node is compiler.ReferenceFindableNode & compiler.ReferenceFindableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.AssertEntry: case SyntaxKind.BindingElement: @@ -3798,7 +3798,7 @@ export class Node { * Gets if the node is a RenameableNode. * @param node - Node to check. */ - static isRenameableNode(node: T | undefined): node is compiler.RenameableNode & compiler.RenameableNodeExtensionType & T { + static isRenameable(node: T | undefined): node is compiler.RenameableNode & compiler.RenameableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.AssertEntry: case SyntaxKind.BindingElement: @@ -3844,7 +3844,7 @@ export class Node { * Gets if the node is a ReturnTypedNode. * @param node - Node to check. */ - static isReturnTypedNode(node: T | undefined): node is compiler.ReturnTypedNode & compiler.ReturnTypedNodeExtensionType & T { + static isReturnTyped(node: T | undefined): node is compiler.ReturnTypedNode & compiler.ReturnTypedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -3870,7 +3870,7 @@ export class Node { * Gets if the node is a ScopeableNode. * @param node - Node to check. */ - static isScopeableNode(node: T | undefined): node is compiler.ScopeableNode & compiler.ScopeableNodeExtensionType & T { + static isScopeable(node: T | undefined): node is compiler.ScopeableNode & compiler.ScopeableNodeExtensionType & T { return node?.getKind() === SyntaxKind.Parameter; } @@ -3878,7 +3878,7 @@ export class Node { * Gets if the node is a ScopedNode. * @param node - Node to check. */ - static isScopedNode(node: T | undefined): node is compiler.ScopedNode & compiler.ScopedNodeExtensionType & T { + static isScoped(node: T | undefined): node is compiler.ScopedNode & compiler.ScopedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.Constructor: case SyntaxKind.GetAccessor: @@ -3984,7 +3984,7 @@ export class Node { * Gets if the node is a StatementedNode. * @param node - Node to check. */ - static isStatementedNode(node: T | undefined): node is compiler.StatementedNode & compiler.StatementedNodeExtensionType & T { + static isStatemented(node: T | undefined): node is compiler.StatementedNode & compiler.StatementedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.Block: @@ -4010,7 +4010,7 @@ export class Node { * Gets if the node is a StaticableNode. * @param node - Node to check. */ - static isStaticableNode(node: T | undefined): node is compiler.StaticableNode & compiler.StaticableNodeExtensionType & T { + static isStaticable(node: T | undefined): node is compiler.StaticableNode & compiler.StaticableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.GetAccessor: case SyntaxKind.MethodDeclaration: @@ -4067,7 +4067,7 @@ export class Node { * Gets if the node is a TextInsertableNode. * @param node - Node to check. */ - static isTextInsertableNode(node: T | undefined): node is compiler.TextInsertableNode & compiler.TextInsertableNodeExtensionType & T { + static isTextInsertable(node: T | undefined): node is compiler.TextInsertableNode & compiler.TextInsertableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.Block: @@ -4138,7 +4138,7 @@ export class Node { * Gets if the node is a TypeArgumentedNode. * @param node - Node to check. */ - static isTypeArgumentedNode(node: T | undefined): node is compiler.TypeArgumentedNode & compiler.TypeArgumentedNodeExtensionType & T { + static isTypeArgumented(node: T | undefined): node is compiler.TypeArgumentedNode & compiler.TypeArgumentedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.CallExpression: case SyntaxKind.ImportType: @@ -4161,7 +4161,7 @@ export class Node { * Gets if the node is a TypedNode. * @param node - Node to check. */ - static isTypedNode(node: T | undefined): node is compiler.TypedNode & compiler.TypedNodeExtensionType & T { + static isTyped(node: T | undefined): node is compiler.TypedNode & compiler.TypedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.AsExpression: case SyntaxKind.NamedTupleMember: @@ -4198,7 +4198,7 @@ export class Node { * Gets if the node is a TypeElementMemberedNode. * @param node - Node to check. */ - static isTypeElementMemberedNode(node: T | undefined): node is compiler.TypeElementMemberedNode & compiler.TypeElementMemberedNodeExtensionType & T { + static isTypeElementMembered(node: T | undefined): node is compiler.TypeElementMemberedNode & compiler.TypeElementMemberedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.InterfaceDeclaration: case SyntaxKind.TypeLiteral: @@ -4212,7 +4212,7 @@ export class Node { * Gets if the node is a TypeLiteralNode. * @param node - Node to check. */ - static isTypeLiteralNode(node: compiler.Node | undefined): node is compiler.TypeLiteralNode { + static isTypeLiteral(node: compiler.Node | undefined): node is compiler.TypeLiteralNode { return node?.getKind() === SyntaxKind.TypeLiteral; } @@ -4284,7 +4284,7 @@ export class Node { * Gets if the node is a TypeParameteredNode. * @param node - Node to check. */ - static isTypeParameteredNode(node: T | undefined): node is compiler.TypeParameteredNode & compiler.TypeParameteredNodeExtensionType & T { + static isTypeParametered(node: T | undefined): node is compiler.TypeParameteredNode & compiler.TypeParameteredNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -4311,7 +4311,7 @@ export class Node { * Gets if the node is a TypePredicateNode. * @param node - Node to check. */ - static isTypePredicateNode(node: compiler.Node | undefined): node is compiler.TypePredicateNode { + static isTypePredicate(node: compiler.Node | undefined): node is compiler.TypePredicateNode { return node?.getKind() === SyntaxKind.TypePredicate; } @@ -4319,7 +4319,7 @@ export class Node { * Gets if the node is a TypeQueryNode. * @param node - Node to check. */ - static isTypeQueryNode(node: compiler.Node | undefined): node is compiler.TypeQueryNode { + static isTypeQuery(node: compiler.Node | undefined): node is compiler.TypeQueryNode { return node?.getKind() === SyntaxKind.TypeQuery; } @@ -4327,7 +4327,7 @@ export class Node { * Gets if the node is a TypeReferenceNode. * @param node - Node to check. */ - static isTypeReferenceNode(node: compiler.Node | undefined): node is compiler.TypeReferenceNode { + static isTypeReference(node: compiler.Node | undefined): node is compiler.TypeReferenceNode { return node?.getKind() === SyntaxKind.TypeReference; } @@ -4381,7 +4381,7 @@ export class Node { * Gets if the node is a UnaryExpressionedNode. * @param node - Node to check. */ - static isUnaryExpressionedNode(node: T | undefined): node is compiler.UnaryExpressionedNode & compiler.UnaryExpressionedNodeExtensionType & T { + static isUnaryExpressioned(node: T | undefined): node is compiler.UnaryExpressionedNode & compiler.UnaryExpressionedNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.AwaitExpression: case SyntaxKind.DeleteExpression: @@ -4409,7 +4409,7 @@ export class Node { * Gets if the node is a UnwrappableNode. * @param node - Node to check. */ - static isUnwrappableNode(node: T | undefined): node is compiler.UnwrappableNode & compiler.UnwrappableNodeExtensionType & T { + static isUnwrappable(node: T | undefined): node is compiler.UnwrappableNode & compiler.UnwrappableNodeExtensionType & T { switch (node?.getKind()) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ModuleDeclaration: diff --git a/packages/ts-morph/src/compiler/ast/module/ModuleDeclaration.ts b/packages/ts-morph/src/compiler/ast/module/ModuleDeclaration.ts index 7eceaa424..5e3867052 100644 --- a/packages/ts-morph/src/compiler/ast/module/ModuleDeclaration.ts +++ b/packages/ts-morph/src/compiler/ast/module/ModuleDeclaration.ts @@ -229,7 +229,7 @@ export class ModuleDeclaration extends ModuleDeclarationBase = {}; - if (Node.isBodyableNode(this) && !this.hasBody()) + if (Node.isBodyable(this) && !this.hasBody()) structure.statements = undefined; else { structure.statements = this.getStatements().map(s => { @@ -948,7 +948,7 @@ export function StatementedNode) { // todo: I don't think it's necessary to do this in two steps anymore and this could probably // be changed to set the body text in one go instead (for performance reasons) - if (Node.isBodyableNode(this) && structure.statements == null && structure.hasOwnProperty(nameof(structure, "statements"))) + if (Node.isBodyable(this) && structure.statements == null && structure.hasOwnProperty(nameof(structure, "statements"))) this.removeBody(); else if (structure.statements != null) { const statementCount = this._getCompilerStatementsWithComments().length; @@ -985,7 +985,7 @@ export function StatementedNode(opts: RemoveChi } export function removeClassMember(classMember: Node) { - if (Node.isOverloadableNode(classMember)) { + if (Node.isOverloadable(classMember)) { if (classMember.isImplementation()) removeClassMembers([...classMember.getOverloads(), classMember]); else { const parent = classMember.getParentOrThrow(); - if (Node.isAmbientableNode(parent) && parent.isAmbient()) + if (Node.isAmbientable(parent) && parent.isAmbient()) removeClassMembers([classMember]); else removeChildren({ children: [classMember], removeFollowingSpaces: true, removeFollowingNewLines: true }); diff --git a/packages/ts-morph/src/manipulation/textManipulators/UnwrapTextManipulator.ts b/packages/ts-morph/src/manipulation/textManipulators/UnwrapTextManipulator.ts index 5069cf1a9..e6505d3f0 100644 --- a/packages/ts-morph/src/manipulation/textManipulators/UnwrapTextManipulator.ts +++ b/packages/ts-morph/src/manipulation/textManipulators/UnwrapTextManipulator.ts @@ -34,9 +34,9 @@ function getReplacementText(node: Node) { if (bodyNode == null) throw new errors.InvalidOperationError("This operation requires the module to have a body."); return bodyNode; - } else if (Node.isBodiedNode(node)) + } else if (Node.isBodied(node)) return node.getBody(); - else if (Node.isBodyableNode(node)) + else if (Node.isBodyable(node)) return node.getBodyOrThrow(); else throw new errors.NotImplementedError(`Not implemented unwrap scenario for ${node.getKindName()}.`); diff --git a/packages/ts-morph/src/tests/compiler/ast/base/name/bindingNamedNodeTests.ts b/packages/ts-morph/src/tests/compiler/ast/base/name/bindingNamedNodeTests.ts index d7aabc527..4ddc77603 100644 --- a/packages/ts-morph/src/tests/compiler/ast/base/name/bindingNamedNodeTests.ts +++ b/packages/ts-morph/src/tests/compiler/ast/base/name/bindingNamedNodeTests.ts @@ -14,7 +14,7 @@ describe("BindingNamedNode", () => { describe(nameof("getName"), () => { function doTest(text: string, expectedName: string) { const { sourceFile } = getInfoFromText(text); - const node = sourceFile.getDescendants().find(Node.isBindingNamedNode)!; + const node = sourceFile.getDescendants().find(Node.isBindingNamed)!; expect(node.getName()).to.equal(expectedName); } diff --git a/packages/ts-morph/src/tests/compiler/ast/base/typedNodeTests.ts b/packages/ts-morph/src/tests/compiler/ast/base/typedNodeTests.ts index b350d1910..5c1081e8a 100644 --- a/packages/ts-morph/src/tests/compiler/ast/base/typedNodeTests.ts +++ b/packages/ts-morph/src/tests/compiler/ast/base/typedNodeTests.ts @@ -195,7 +195,7 @@ describe("TypedNode", () => { describe(nameof("set"), () => { function doTest(startingCode: string, structure: TypedNodeStructure, expectedCode: string) { const { sourceFile } = getInfoFromText(startingCode); - const firstTyped = sourceFile.getFirstDescendant(Node.isTypedNode); + const firstTyped = sourceFile.getFirstDescendant(Node.isTyped); (firstTyped as TypeAliasDeclaration).set(structure); expect(sourceFile.getText()).to.equal(expectedCode); } diff --git a/packages/ts-morph/src/tests/compiler/ast/common/nodeTests.ts b/packages/ts-morph/src/tests/compiler/ast/common/nodeTests.ts index de73aaae2..b36a6f468 100644 --- a/packages/ts-morph/src/tests/compiler/ast/common/nodeTests.ts +++ b/packages/ts-morph/src/tests/compiler/ast/common/nodeTests.ts @@ -1818,7 +1818,7 @@ class MyClass { const { sourceFile } = getInfoFromText("const t = 5;"); const nodeTexts: string[] = []; sourceFile.forEachDescendant(node => { - if (Node.isTypedNode(node)) + if (Node.isTyped(node)) node.setType("any"); nodeTexts.push(node.getText()); }); @@ -1838,9 +1838,9 @@ class MyClass { const { sourceFile } = getInfoFromText("let t: any = 5;"); const nodeTexts: string[] = []; sourceFile.forEachDescendant(node => { - if (Node.isInitializerExpressionableNode(node)) + if (Node.isInitializerExpressionable(node)) node.removeInitializer(); - if (Node.isTypedNode(node)) + if (Node.isTyped(node)) node.removeType(); nodeTexts.push(node.getText()); }); diff --git a/packages/ts-morph/src/tests/issues/0460tests.ts b/packages/ts-morph/src/tests/issues/0460tests.ts index cb005f7b8..b8979d36f 100644 --- a/packages/ts-morph/src/tests/issues/0460tests.ts +++ b/packages/ts-morph/src/tests/issues/0460tests.ts @@ -13,7 +13,7 @@ export declare function baz(...args: any[]): void;`; const { sourceFile } = getInfoFromText(fileText, { isDefinitionFile: true }); sourceFile.forEachChild(child => { - if (Node.isAmbientableNode(child)) + if (Node.isAmbientable(child)) child.setHasDeclareKeyword(false); });