Skip to content

Commit

Permalink
fix: don't use arrow function introduced in 2.4.1
Browse files Browse the repository at this point in the history
There is ES6 syntax introduced in the latest release 2.4.1. Meanwhile the whole package is written in ES5 (`var` instead of `const`, etc).

Introducing this tiny use of arrow function renders usage of this module in browsers like IE11 impossible.

I hope it's not a big deal to stick with older syntax to remain consistent with code style and browser/node support
  • Loading branch information
vladgolubev committed Apr 5, 2019
1 parent bd2795a commit 2e00b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mime.js
Expand Up @@ -38,7 +38,7 @@ function Mime() {
*/
Mime.prototype.define = function(typeMap, force) {
for (var type in typeMap) {
var extensions = typeMap[type].map(t => t.toLowerCase());
var extensions = typeMap[type].map(function(t) {return t.toLowerCase()});
type = type.toLowerCase();

for (var i = 0; i < extensions.length; i++) {
Expand Down

0 comments on commit 2e00b5c

Please sign in to comment.