feature/IO-3066-1-scaffolding: Minor cleanup

This commit is contained in:
Dave Richer
2025-04-16 14:55:11 -04:00
parent 8b7280f66c
commit b683d054ed
10 changed files with 69 additions and 46 deletions

View File

@@ -3,9 +3,9 @@ import fs from "fs";
import path from "path";
import errorTypeCheck from "../../util/errorTypeCheck";
const createdDirectoryIfNotExist = async (dirpath: string) => {
const createdDirectoryIfNotExist = async (dirPath: string) => {
try {
const directoryPath = path.dirname(dirpath);
const directoryPath = path.dirname(dirPath);
if (!fs.existsSync(directoryPath)) {
log.info(`Directory does not exist. Creating: ${directoryPath}`);
fs.mkdirSync(directoryPath, { recursive: true });

View File

@@ -1,9 +1,8 @@
import { BrowserWindow } from "electron";
import {BrowserWindow} from "electron";
import log from "electron-log/main";
const getMainWindow = (): Electron.BrowserWindow => {
const mainWindow = BrowserWindow.getAllWindows()[0];
return mainWindow;
return BrowserWindow.getAllWindows()[0];
};
const sendIpcToRenderer = (ipcMessage: string, ...args: any[]): void => {

View File

@@ -13,12 +13,9 @@ function uppercaseObjectKeys<T extends Record<string, any>>(
return Object.entries(obj).reduce(
(result, [key, value]) => {
const uppercaseKey = key.toUpperCase();
const newValue =
typeof value === "object" && value !== null
result[uppercaseKey] = typeof value === "object" && value !== null
? uppercaseObjectKeys(value)
: value;
result[uppercaseKey] = newValue;
return result;
},
{} as Record<string, any>,