Change export convention for helper functions

This commit is contained in:
Tuan Dang
2023-06-05 21:00:23 +01:00
parent 0c18bd71c4
commit 5f5ed5d0a9
22 changed files with 133 additions and 176 deletions
+2 -7
View File
@@ -7,7 +7,7 @@ import { getLogger } from '../utils/logger';
* @param {String} obj.mongoURL - mongo connection string
* @returns
*/
const initDatabaseHelper = async ({
export const initDatabaseHelper = async ({
mongoURL
}: {
mongoURL: string;
@@ -30,7 +30,7 @@ const initDatabaseHelper = async ({
/**
* Close database conection
*/
const closeDatabaseHelper = async () => {
export const closeDatabaseHelper = async () => {
return Promise.all([
new Promise((resolve) => {
if (mongoose.connection && mongoose.connection.readyState == 1) {
@@ -41,9 +41,4 @@ const closeDatabaseHelper = async () => {
}
})
]);
}
export {
initDatabaseHelper,
closeDatabaseHelper
}