From 2e00b5c94a549926b3618d22a33d7c16c3359b74 Mon Sep 17 00:00:00 2001 From: Vlad Holubiev Date: Fri, 5 Apr 2019 18:13:00 +0300 Subject: [PATCH] fix: don't use arrow function introduced in 2.4.1 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 --- Mime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mime.js b/Mime.js index e5df5b22..7fe39211 100644 --- a/Mime.js +++ b/Mime.js @@ -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++) {