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);
|
return utils.languageKeyRegex.test(input);
|
||||||
},
|
},
|
||||||
userLangToTimeagoCode: function (userLang) {
|
userLangToTimeagoCode: function (userLang) {
|
||||||
const mapping = Object.create(null, {
|
const mapping = {
|
||||||
'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.hasOwnProperty(userLang) ? mapping[userLang] : userLang;
|
||||||
},
|
},
|
||||||
// shallow objects merge
|
// shallow objects merge
|
||||||
merge: function () {
|
merge: function () {
|
||||||
@@ -397,7 +397,7 @@
|
|||||||
return ('' + path).split('.').pop();
|
return ('' + path).split('.').pop();
|
||||||
},
|
},
|
||||||
|
|
||||||
extensionMimeTypeMap: Object.create(null, {
|
extensionMimeTypeMap: {
|
||||||
bmp: 'image/bmp',
|
bmp: 'image/bmp',
|
||||||
cmx: 'image/x-cmx',
|
cmx: 'image/x-cmx',
|
||||||
cod: 'image/cis-cod',
|
cod: 'image/cis-cod',
|
||||||
@@ -421,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