Comparing version 1.2.10 to 1.2.11
@@ -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" | ||
} |
24
test.js
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
65068
0