function Mime(){this.types=Object.create(null);this.extensions=Object.create(null)}var path=require("path"),fs=require("fs");Mime.prototype.define=function(e){for(var t in e){for(var i=e[t],s=0;s<i.length;s++){process.env.DEBUG_MIME&&this.types[i]&&console.warn(this._loading.replace(/.*\//,""),'changes "'+i[s]+'" extension type from '+this.types[i]+" to "+t);this.types[i[s]]=t}this.extensions[t]||(this.extensions[t]=i[0])}};Mime.prototype.load=function(e){this._loading=e;var t={},i=fs.readFileSync(e,"ascii"),s=i.split(/[\r\n]+/);s.forEach(function(e){var i=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);t[i.shift()]=i});this.define(t);this._loading=null};Mime.prototype.lookup=function(e,t){var i=e.replace(/.*[\.\/\\]/,"").toLowerCase();return this.types[i]||t||this.default_type};Mime.prototype.extension=function(e){var t=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[t]};var mime=new Mime;mime.load(path.join(__dirname,"types/mime.types"));mime.load(path.join(__dirname,"types/node.types"));mime.default_type=mime.lookup("bin");mime.Mime=Mime;mime.charsets={lookup:function(e,t){return/^text\//.test(e)?"UTF-8":t}};module.exports=mime;