From 2b1a96cf9950dac4735956f3b6a9804ed6d60f91 Mon Sep 17 00:00:00 2001 From: Zaran Lalvani Date: Thu, 2 May 2024 16:37:16 -0400 Subject: [PATCH] fix: add var declaration to exportable types --- .../src/services/language/typescript/process.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bumpgen-core/src/services/language/typescript/process.ts b/packages/bumpgen-core/src/services/language/typescript/process.ts index 9fca558..cc1de6e 100644 --- a/packages/bumpgen-core/src/services/language/typescript/process.ts +++ b/packages/bumpgen-core/src/services/language/typescript/process.ts @@ -11,6 +11,7 @@ import type { SourceFile, TypeAliasDeclaration, VariableDeclaration, + VariableStatement, } from "ts-morph"; import { Node, SyntaxKind } from "ts-morph"; @@ -116,14 +117,16 @@ const isExportableType = ( | ClassDeclaration | FunctionDeclaration | VariableDeclaration - | TypeAliasDeclaration => { + | TypeAliasDeclaration + | VariableStatement => { return ( node.getKind() === SyntaxKind.ModuleDeclaration || node.getKind() === SyntaxKind.InterfaceDeclaration || node.getKind() === SyntaxKind.ClassDeclaration || node.getKind() === SyntaxKind.FunctionDeclaration || node.getKind() === SyntaxKind.VariableDeclaration || - node.getKind() === SyntaxKind.TypeAliasDeclaration + node.getKind() === SyntaxKind.TypeAliasDeclaration || + node.getKind() === SyntaxKind.VariableStatement ); };