From 97d51a7763b14c92ee71ff9a012311dd9498d803 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Sun, 8 Aug 2021 00:01:37 +0000 Subject: refactor: path-references refactoring and using 'import' instead of 'require' (#1752) * refactor references to 'userData' and 'appData' directories to move hardcoding into single location * convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/ --- src/models/Recipe.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/models/Recipe.js') diff --git a/src/models/Recipe.js b/src/models/Recipe.js index 106b4a56a..92ff0d67d 100644 --- a/src/models/Recipe.js +++ b/src/models/Recipe.js @@ -1,7 +1,7 @@ import emailParser from 'address-rfc2822'; import semver from 'semver'; -import fs from 'fs-extra'; -import path from 'path'; +import { pathExistsSync } from 'fs-extra'; +import { join } from 'path'; export default class Recipe { id = ''; @@ -98,6 +98,6 @@ export default class Recipe { } get hasDarkMode() { - return fs.pathExistsSync(path.join(this.path, 'darkmode.css')); + return pathExistsSync(join(this.path, 'darkmode.css')); } } -- cgit v1.2.3-70-g09d2