From 9d5c71e86ea1b09442141956d52beab6f639b0bc Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Mon, 28 Oct 2024 09:30:47 -0400 Subject: [PATCH] linting --- helpers/functions.database.d.ts | 2 +- helpers/functions.database.js | 6 +++--- helpers/functions.database.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/functions.database.d.ts b/helpers/functions.database.d.ts index d01aee43..04e6541a 100644 --- a/helpers/functions.database.d.ts +++ b/helpers/functions.database.d.ts @@ -1 +1 @@ -export declare const backupDatabase: () => Promise; +export declare function backupDatabase(): Promise; diff --git a/helpers/functions.database.js b/helpers/functions.database.js index abd29f67..b5a19f18 100644 --- a/helpers/functions.database.js +++ b/helpers/functions.database.js @@ -1,7 +1,7 @@ import fs from 'node:fs/promises'; import { backupFolder, lotOccupancyDB as databasePath } from '../data/databasePaths.js'; -export const backupDatabase = async () => { - const databasePathSplit = databasePath.split(/[/\\]/g); +export async function backupDatabase() { + const databasePathSplit = databasePath.split(/[/\\]/); const backupDatabasePath = `${backupFolder}/${databasePathSplit.at(-1)}.${Date.now().toString()}`; try { await fs.copyFile(databasePath, backupDatabasePath); @@ -10,4 +10,4 @@ export const backupDatabase = async () => { catch { return false; } -}; +} diff --git a/helpers/functions.database.ts b/helpers/functions.database.ts index 0375e4f1..96e710bc 100644 --- a/helpers/functions.database.ts +++ b/helpers/functions.database.ts @@ -5,8 +5,8 @@ import { lotOccupancyDB as databasePath } from '../data/databasePaths.js' -export const backupDatabase = async (): Promise => { - const databasePathSplit = databasePath.split(/[/\\]/g) +export async function backupDatabase(): Promise { + const databasePathSplit = databasePath.split(/[/\\]/) const backupDatabasePath = `${backupFolder}/${databasePathSplit.at(-1)}.${Date.now().toString()}`