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