mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: remove useless catchs and empty line
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
'use strict';
|
||||
|
||||
const util = require('util');
|
||||
|
||||
@@ -13,13 +13,8 @@ const files = fs.readdirSync(path.join(__dirname, '../public/vendor/jquery/timea
|
||||
Languages.timeagoCodes = files.filter(f => f.startsWith('jquery.timeago')).map(f => f.split('.')[2]);
|
||||
|
||||
Languages.get = async function (language, namespace) {
|
||||
let data = await readFileAsync(path.join(languagesPath, language, namespace + '.json'), 'utf8');
|
||||
try {
|
||||
data = JSON.parse(data) || {};
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
return data;
|
||||
const data = await readFileAsync(path.join(languagesPath, language, namespace + '.json'), 'utf8');
|
||||
return JSON.parse(data) || {};
|
||||
};
|
||||
|
||||
let codeCache = null;
|
||||
|
||||
@@ -134,11 +134,7 @@ widgets.getArea = async function (template, location) {
|
||||
if (!result) {
|
||||
return [];
|
||||
}
|
||||
try {
|
||||
return parseWidgetData(result);
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
function parseWidgetData(data) {
|
||||
|
||||
Reference in New Issue
Block a user