🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

mime

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mime - npm Package Compare versions

Comparing version

to
1.2.11

2

mime.js

@@ -72,3 +72,3 @@ var path = require('path');

Mime.prototype.lookup = function(path, fallback) {
var ext = path.replace(/.*[\.\/]/, '').toLowerCase();
var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();

@@ -75,0 +75,0 @@ return this.types[ext] || fallback || this.default_type;

@@ -21,3 +21,3 @@ {

"repository": {"url": "https://github.com/broofa/node-mime", "type": "git"},
"version": "1.2.10"
"version": "1.2.11"
}

@@ -21,12 +21,12 @@ /**

eq('text/plain', mime.lookup('text.txt'));
eq('text/plain', mime.lookup('.text.txt'));
eq('text/plain', mime.lookup('.txt'));
eq('text/plain', mime.lookup('txt'));
eq('application/octet-stream', mime.lookup('text.nope'));
eq('fallback', mime.lookup('text.fallback', 'fallback'));
eq('application/octet-stream', mime.lookup('constructor'));
eq('text/plain', mime.lookup('TEXT.TXT'));
eq('text/event-stream', mime.lookup('text/event-stream'));
eq('application/x-web-app-manifest+json', mime.lookup('text.webapp'));
eq('text/plain', mime.lookup('text.txt')); // normal file
eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase
eq('text/plain', mime.lookup('dir/text.txt')); // dir + file
eq('text/plain', mime.lookup('.text.txt')); // hidden file
eq('text/plain', mime.lookup('.txt')); // nameless
eq('text/plain', mime.lookup('txt')); // extension-only
eq('text/plain', mime.lookup('/txt')); // extension-less ()
eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less
eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized
eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default

@@ -47,6 +47,6 @@ //

eq('html', mime.extension('text/Html;charset=UTF-8'));
eq(undefined, mime.extension('constructor'));
eq(undefined, mime.extension('unrecognized'));
//
// Test node types
// Test node.types lookups
//

@@ -53,0 +53,0 @@