feature/IO-3066-1-scaffolding: Minor cleanup
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user