refactor: remove object.create

isekai-main
Barış Soner Uşaklı 3 years ago
parent 3d3ae82f5b
commit dbba0c396b

@ -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));

Loading…
Cancel
Save