mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: remove unused args
This commit is contained in:
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
(function (factory) {
|
(function (factory) {
|
||||||
if (typeof module === 'object' && module.exports) {
|
if (typeof module === 'object' && module.exports) {
|
||||||
const winston = require('winston');
|
module.exports = factory();
|
||||||
|
|
||||||
module.exports = factory(require('xregexp'), winston);
|
|
||||||
|
|
||||||
process.profile = function (operation, start) {
|
process.profile = function (operation, start) {
|
||||||
console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start));
|
console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start));
|
||||||
@@ -15,14 +13,12 @@
|
|||||||
return (diff[0] * 1e3) + (diff[1] / 1e6);
|
return (diff[0] * 1e3) + (diff[1] / 1e6);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
window.utils = factory(window.XRegExp, console);
|
window.utils = factory();
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}(function (XRegExp, console) {
|
}(function () {
|
||||||
const freeze = Object.freeze || function (obj) { return obj; };
|
|
||||||
|
|
||||||
// add default escape function for escaping HTML entities
|
// add default escape function for escaping HTML entities
|
||||||
const escapeCharMap = freeze({
|
const escapeCharMap = Object.freeze({
|
||||||
'&': '&',
|
'&': '&',
|
||||||
'<': '<',
|
'<': '<',
|
||||||
'>': '>',
|
'>': '>',
|
||||||
@@ -36,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
const escapeChars = /[&<>"'`=]/g;
|
const escapeChars = /[&<>"'`=]/g;
|
||||||
|
|
||||||
const HTMLEntities = freeze({
|
const HTMLEntities = Object.freeze({
|
||||||
amp: '&',
|
amp: '&',
|
||||||
gt: '>',
|
gt: '>',
|
||||||
lt: '<',
|
lt: '<',
|
||||||
@@ -373,13 +369,13 @@
|
|||||||
return utils.languageKeyRegex.test(input);
|
return utils.languageKeyRegex.test(input);
|
||||||
},
|
},
|
||||||
userLangToTimeagoCode: function (userLang) {
|
userLangToTimeagoCode: function (userLang) {
|
||||||
const mapping = {
|
const mapping = Object.create(null, {
|
||||||
'en-GB': 'en',
|
'en-GB': 'en',
|
||||||
'en-US': 'en',
|
'en-US': 'en',
|
||||||
'fa-IR': 'fa',
|
'fa-IR': 'fa',
|
||||||
'pt-BR': 'pt-br',
|
'pt-BR': 'pt-br',
|
||||||
nb: 'no',
|
nb: 'no',
|
||||||
};
|
});
|
||||||
return mapping[userLang] || userLang;
|
return mapping[userLang] || userLang;
|
||||||
},
|
},
|
||||||
// shallow objects merge
|
// shallow objects merge
|
||||||
@@ -401,7 +397,7 @@
|
|||||||
return ('' + path).split('.').pop();
|
return ('' + path).split('.').pop();
|
||||||
},
|
},
|
||||||
|
|
||||||
extensionMimeTypeMap: {
|
extensionMimeTypeMap: Object.create(null, {
|
||||||
bmp: 'image/bmp',
|
bmp: 'image/bmp',
|
||||||
cmx: 'image/x-cmx',
|
cmx: 'image/x-cmx',
|
||||||
cod: 'image/cis-cod',
|
cod: 'image/cis-cod',
|
||||||
@@ -425,7 +421,7 @@
|
|||||||
xbm: 'image/x-xbitmap',
|
xbm: 'image/x-xbitmap',
|
||||||
xpm: 'image/x-xpixmap',
|
xpm: 'image/x-xpixmap',
|
||||||
xwd: 'image/x-xwindowdump',
|
xwd: 'image/x-xwindowdump',
|
||||||
},
|
}),
|
||||||
|
|
||||||
fileMimeType: function (path) {
|
fileMimeType: function (path) {
|
||||||
return utils.extensionToMimeType(utils.fileExtension(path));
|
return utils.extensionToMimeType(utils.fileExtension(path));
|
||||||
|
|||||||
Reference in New Issue
Block a user