broofa / mime

Mime types for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`define` doesn't seem to work?

stevendesu opened this issue · comments

I have the following code:

const mime = require("mime");
mime.define({"text/plain": ["LICENSE"]);
console.log(mime.getType("test.LICENSE"));

This is outputting null. I've also tried:

const Mime = require("mime/Mime");
const mime = new Mime({"text/plain": ["LICENSE"]);
console.log(mime.getType("test.LICENSE"));

And I've tried just:

const mime = require("mime");
mime.define({"text/plain": ["LICENSE"]);
console.log(mime.getType("LICENSE"));

None of these seem to work. They all return null instead of the desired "text/plain"

I'm using mime @ 2.4.0

Published as v2.4.1

(Good catch, btw! Thanks for reporting.)