Browse Source

remove no-shadow lint issue

SaltyMonkey 6 years ago
parent
commit
bda21caa8a
1 changed files with 9 additions and 9 deletions
  1. 9 9
      lib/helpers/utils.js

+ 9 - 9
lib/helpers/utils.js

@@ -40,14 +40,14 @@ exports.stringHasIntersect = (string, arr) => {
 
 /**
 * Load JSON file in async style
-* @param {string} path path to file
+* @param {string} filepath path to file
 * @param {string} encoding file encoding
 * @returns {Object|false} return false if failed or Object if successful
 */
-exports.loadJsonAsync = async (path, encoding = "utf8") => {
+exports.loadJsonAsync = async (filepath, encoding = "utf8") => {
 	let result = false;
 	try {
-		result = await fsAsync.readFile(path, encoding);
+		result = await fsAsync.readFile(filepath, encoding);
 	}
 	// eslint-disable-next-line no-empty
 	catch (ex) { }
@@ -66,13 +66,13 @@ exports.getFullPath = (str1, str2) => path.resolve(str1, str2);
 
 /**
 * Load JSON file iin sync way
-* @param {string} path path to file
+* @param {string} filepath path to file
 * @param {string} encoding file encoding
 * @returns {Object|false} return false if failed or Object if successful
 */
-exports.loadJson = (path, encoding = "utf8") => {
+exports.loadJson = (filepath, encoding = "utf8") => {
 	try {
-		return JSON.parse(fs.readFileSync(path, encoding));
+		return JSON.parse(fs.readFileSync(filepath, encoding));
 	} catch (err) {
 		return false;
 	}
@@ -81,12 +81,12 @@ exports.loadJson = (path, encoding = "utf8") => {
 /**
 * Save JSON file synchronously with format
 * @param {string} obj object to save
-* @param {string} path path
+* @param {string} filepath path
 * @returns {undefined|false} returns false if error happened
 */
-exports.saveJson = (obj, path) => {
+exports.saveJson = (obj, filepath) => {
 	try {
-		fs.writeFileSync(path, JSON.stringify(obj, null, "\t"));
+		fs.writeFileSync(filepath, JSON.stringify(obj, null, "\t"));
 	} catch (err) {
 		return false;
 	}