import { unixEOL } from '@sap-cloud-sdk/util' ; import { StructureKind , VariableDeclarationKind , VariableStatementStructure } from 'ts-morph' ; import { VdmFunctionImport , VdmActionImport } from '../vdm-types' ; internal export function exportStatement ( actionFunctionImports , name ) { return { kind : StructureKind . VariableStatement , declarationKind : VariableDeclarationKind . Const , declarations : [ { name , initializer : exportsInitializer ( actionFunctionImports ) } ] , isExported : true } ; } function exportsInitializer ( actionFunctionImports ) { return ( actionFunctionImports . reduce ( ( initializer , currentImport ) => { if ( initializer !== `{${ unixEOL }` ) { initializer += `,${ unixEOL }` ; } initializer += `${ currentImport . name }` ; return initializer ; } , `{${ unixEOL }` ) + `${ unixEOL }}` ) ; }