@@ -30,7 +30,7 @@ import { getStateLogsTableName } from './MigrationStateManager';
3030/**
3131 * Checks correctness of connection details of both MySQL and PostgreSQL.
3232 */
33- export async function checkConnection ( conversion : Conversion ) : Promise < string > {
33+ export const checkConnection = async ( conversion : Conversion ) : Promise < string > = > {
3434 let resultMessage : string = '' ;
3535 const params : IDBAccessQueryParams = {
3636 conversion : conversion ,
@@ -48,12 +48,12 @@ export async function checkConnection(conversion: Conversion): Promise<string> {
4848 const pgResult : DBAccessQueryResult = await DBAccess . query ( params ) ;
4949 resultMessage += pgResult . error ? `\tPostgreSQL connection error: ${ JSON . stringify ( pgResult . error ) } ` : '' ;
5050 return resultMessage ;
51- }
51+ } ;
5252
5353/**
5454 * Returns Nmig's logo.
5555 */
56- export function getLogo ( ) : string {
56+ export const getLogo = ( ) : string => {
5757 return '\n\t/\\_ |\\ /\\/\\ /\\___'
5858 + '\n\t| \\ | |\\ | | | __'
5959 + '\n\t| |\\\\| || | | | \\_ \\'
@@ -62,12 +62,12 @@ export function getLogo(): string {
6262 + '\n\n\tNMIG - the database migration tool'
6363 + '\n\tCopyright (C) 2016 - present, Anatoly Khaytovich <anatolyuss@gmail.com>\n\n'
6464 + '\t--[boot] Configuration has been just loaded.' ;
65- }
65+ } ;
6666
6767/**
6868 * Boots the migration.
6969 */
70- export function boot ( conversion : Conversion ) : Promise < Conversion > {
70+ export const boot = ( conversion : Conversion ) : Promise < Conversion > = > {
7171 return new Promise < Conversion > ( async resolve => {
7272 const connectionErrorMessage = await checkConnection ( conversion ) ;
7373 const logo : string = getLogo ( ) ;
@@ -97,7 +97,7 @@ export function boot(conversion: Conversion): Promise<Conversion> {
9797
9898 console . log ( logo + message ) ;
9999
100- const _getUserInput = ( input : string ) => {
100+ const _getUserInput = ( input : string ) : void => {
101101 const trimedInput : string = input . trim ( ) ;
102102
103103 if ( trimedInput === 'n' || trimedInput === 'N' ) {
@@ -122,7 +122,7 @@ export function boot(conversion: Conversion): Promise<Conversion> {
122122 . setEncoding ( conversion . _encoding )
123123 . on ( 'data' , _getUserInput ) ;
124124 } ) ;
125- }
125+ } ;
126126
127127/**
128128 * Parses CLI input arguments, if given.
@@ -132,9 +132,9 @@ export function boot(conversion: Conversion): Promise<Conversion> {
132132 * npm start -- --conf-dir='C:\Users\anatolyuss\Documents\projects\nmig_config' --logs-dir='C:\Users\anatolyuss\Documents\projects\nmig_logs'
133133 * npm test -- --conf-dir='C:\Users\anatolyuss\Documents\projects\nmig_config' --logs-dir='C:\Users\anatolyuss\Documents\projects\nmig_logs'
134134 */
135- export function getConfAndLogsPaths ( ) : IConfAndLogsPaths {
135+ export const getConfAndLogsPaths = ( ) : IConfAndLogsPaths => {
136136 const baseDir : string = path . join ( __dirname , '..' , '..' ) ;
137- const _parseInputArguments = ( paramName : string ) => {
137+ const _parseInputArguments = ( paramName : string ) : string | undefined => {
138138 const _path : string | undefined = process . argv . find ( ( arg : string ) => arg . startsWith ( paramName ) ) ;
139139 return _path ? _path . split ( '=' ) [ 1 ] : undefined ;
140140 } ;
@@ -143,4 +143,4 @@ export function getConfAndLogsPaths(): IConfAndLogsPaths {
143143 confPath : _parseInputArguments ( '--conf-dir' ) || path . join ( baseDir , 'config' ) ,
144144 logsPath : _parseInputArguments ( '--logs-dir' ) || baseDir
145145 } ;
146- }
146+ } ;
0 commit comments