Use Prettier

This commit is contained in:
prototypa
2022-09-11 03:51:55 -04:00
parent 51362812c8
commit d909adb658
52 changed files with 1487 additions and 1447 deletions

View File

@ -1,22 +1,22 @@
import path from "path";
import { fileURLToPath } from "url";
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** */
export const getProjectRootDir = () => {
const mode = import.meta.env.MODE;
const mode = import.meta.env.MODE;
return mode === "production" ? path.join(__dirname, "../") : path.join(__dirname, "../../");
return mode === 'production' ? path.join(__dirname, '../') : path.join(__dirname, '../../');
};
const __srcFolder = path.join(getProjectRootDir(), "/src");
const __srcFolder = path.join(getProjectRootDir(), '/src');
/** */
export const getRelativeUrlByFilePath = (filepath) => {
if (filepath) {
return filepath.replace(__srcFolder, "");
}
if (filepath) {
return filepath.replace(__srcFolder, '');
}
return null;
return null;
};