mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
refactor: remove object.create
This commit is contained in:
@@ -369,14 +369,14 @@
|
||||
return utils.languageKeyRegex.test(input);
|
||||
},
|
||||
userLangToTimeagoCode: function (userLang) {
|
||||
const mapping = Object.create(null, {
|
||||
const mapping = {
|
||||
'en-GB': 'en',
|
||||
'en-US': 'en',
|
||||
'fa-IR': 'fa',
|
||||
'pt-BR': 'pt-br',
|
||||
nb: 'no',
|
||||
});
|
||||
return mapping[userLang] || userLang;
|
||||
};
|
||||
return mapping.hasOwnProperty(userLang) ? mapping[userLang] : userLang;
|
||||
},
|
||||
// shallow objects merge
|
||||
merge: function () {
|
||||
@@ -397,7 +397,7 @@
|
||||
return ('' + path).split('.').pop();
|
||||
},
|
||||
|
||||
extensionMimeTypeMap: Object.create(null, {
|
||||
extensionMimeTypeMap: {
|
||||
bmp: 'image/bmp',
|
||||
cmx: 'image/x-cmx',
|
||||
cod: 'image/cis-cod',
|
||||
@@ -421,7 +421,7 @@
|
||||
xbm: 'image/x-xbitmap',
|
||||
xpm: 'image/x-xpixmap',
|
||||
xwd: 'image/x-xwindowdump',
|
||||
}),
|
||||
},
|
||||
|
||||
fileMimeType: function (path) {
|
||||
return utils.extensionToMimeType(utils.fileExtension(path));
|
||||
|
||||
Reference in New Issue
Block a user