Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Oct 28, 2024
1 parent 4b8b483 commit 9d5c71e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion helpers/functions.database.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const backupDatabase: () => Promise<string | false>;
export declare function backupDatabase(): Promise<string | false>;
6 changes: 3 additions & 3 deletions helpers/functions.database.js
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -10,4 +10,4 @@ export const backupDatabase = async () => {
catch {
return false;
}
};
}
4 changes: 2 additions & 2 deletions helpers/functions.database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
lotOccupancyDB as databasePath
} from '../data/databasePaths.js'

export const backupDatabase = async (): Promise<string | false> => {
const databasePathSplit = databasePath.split(/[/\\]/g)
export async function backupDatabase(): Promise<string | false> {
const databasePathSplit = databasePath.split(/[/\\]/)

const backupDatabasePath = `${backupFolder}/${databasePathSplit.at(-1)}.${Date.now().toString()}`

Expand Down

0 comments on commit 9d5c71e

Please sign in to comment.