mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
Pardon the noise. More tab to space conversion!
This commit is contained in:
parent
c3635bb26b
commit
1d8be6b014
128 changed files with 8017 additions and 8017 deletions
|
@ -1,26 +1,26 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
// deps
|
||||
const _ = require('lodash');
|
||||
// deps
|
||||
const _ = require('lodash');
|
||||
|
||||
const mimeTypes = require('mime-types');
|
||||
const mimeTypes = require('mime-types');
|
||||
|
||||
exports.startup = startup;
|
||||
exports.resolveMimeType = resolveMimeType;
|
||||
exports.startup = startup;
|
||||
exports.resolveMimeType = resolveMimeType;
|
||||
|
||||
function startup(cb) {
|
||||
//
|
||||
// Add in types (not yet) supported by mime-db -- and therefor, mime-types
|
||||
// Add in types (not yet) supported by mime-db -- and therefor, mime-types
|
||||
//
|
||||
const ADDITIONAL_EXT_MIMETYPES = {
|
||||
ans : 'text/x-ansi',
|
||||
gz : 'application/gzip', // not in mime-types 2.1.15 :(
|
||||
lzx : 'application/x-lzx', // :TODO: submit to mime-types
|
||||
ans : 'text/x-ansi',
|
||||
gz : 'application/gzip', // not in mime-types 2.1.15 :(
|
||||
lzx : 'application/x-lzx', // :TODO: submit to mime-types
|
||||
};
|
||||
|
||||
_.forEach(ADDITIONAL_EXT_MIMETYPES, (mimeType, ext) => {
|
||||
// don't override any entries
|
||||
// don't override any entries
|
||||
if(!_.isString(mimeTypes.types[ext])) {
|
||||
mimeTypes[ext] = mimeType;
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ function startup(cb) {
|
|||
|
||||
function resolveMimeType(query) {
|
||||
if(mimeTypes.extensions[query]) {
|
||||
return query; // alreaed a mime-type
|
||||
return query; // alreaed a mime-type
|
||||
}
|
||||
|
||||
return mimeTypes.lookup(query) || undefined; // lookup() returns false; we want undefined
|
||||
return mimeTypes.lookup(query) || undefined; // lookup() returns false; we want undefined
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue