es-mime-types
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -23,4 +23,3 @@ import db from 'mime-db'; | ||
if (types[extension] !== 'application/octet-stream' && | ||
(from > to || | ||
(from === to && types[extension].substr(0, 12) === 'application/'))) { | ||
(from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { | ||
// skip the remapping | ||
@@ -65,3 +64,3 @@ continue; | ||
} | ||
let mime = str.indexOf('/') === -1 ? exports.lookup(str) : str; | ||
let mime = str.indexOf('/') === -1 ? lookup(str) : str; | ||
if (!mime) { | ||
@@ -72,5 +71,5 @@ return false; | ||
if (mime.indexOf('charset') === -1) { | ||
const charset = exports.charset(mime); | ||
if (charset) | ||
mime += '; charset=' + charset.toLowerCase(); | ||
const ch = charset(mime); | ||
if (ch) | ||
mime += '; charset=' + ch.toLowerCase(); | ||
} | ||
@@ -89,3 +88,3 @@ return mime; | ||
// get extensions | ||
const exts = match && exports.extensions[match[1].toLowerCase()]; | ||
const exts = match && extensions[match[1].toLowerCase()]; | ||
if (!exts || !exts.length) { | ||
@@ -110,5 +109,5 @@ return false; | ||
} | ||
return exports.types[extension] || false; | ||
return types[extension] || false; | ||
} | ||
export { charset, contentType, extension, extensions, lookup, types }; |
{ | ||
"name": "es-mime-types", | ||
"description": "mime-types rewrite in TypeScript with ESM and CommonJS targets", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"repository": "https://github.com/talentlessguy/es-mime-types.git", | ||
@@ -38,6 +38,6 @@ "keywords": [ | ||
"@types/mime-db": "^1.43.0", | ||
"@types/node": "^14.6.0", | ||
"rollup": "^2.26.5", | ||
"@types/node": "^14.11.1", | ||
"rollup": "^2.27.1", | ||
"rollup-plugin-typescript2": "^0.27.2", | ||
"typescript": "^4.0.2" | ||
"typescript": "^4.0.3" | ||
}, | ||
@@ -44,0 +44,0 @@ "dependencies": { |
@@ -30,4 +30,3 @@ import db from 'mime-db' | ||
types[extension] !== 'application/octet-stream' && | ||
(from > to || | ||
(from === to && types[extension].substr(0, 12) === 'application/')) | ||
(from > to || (from === to && types[extension].substr(0, 12) === 'application/')) | ||
) { | ||
@@ -86,3 +85,3 @@ // skip the remapping | ||
let mime = str.indexOf('/') === -1 ? exports.lookup(str) : str | ||
let mime = str.indexOf('/') === -1 ? lookup(str) : str | ||
@@ -95,4 +94,4 @@ if (!mime) { | ||
if (mime.indexOf('charset') === -1) { | ||
const charset = exports.charset(mime) | ||
if (charset) mime += '; charset=' + charset.toLowerCase() | ||
const ch = charset(mime) as string | ||
if (ch) mime += '; charset=' + ch.toLowerCase() | ||
} | ||
@@ -115,3 +114,3 @@ | ||
// get extensions | ||
const exts = match && exports.extensions[match[1].toLowerCase()] | ||
const exts = match && extensions[match[1].toLowerCase()] | ||
@@ -142,3 +141,3 @@ if (!exts || !exts.length) { | ||
return exports.types[extension] || false | ||
return types[extension] || false | ||
} |
Sorry, the diff of this file is not supported yet
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
16037
347