@tinyhttp/type-is
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -7,3 +7,2 @@ /** | ||
*/ | ||
export declare const typeIs: (value: string, ...types: string[]) => any; | ||
//# sourceMappingURL=index.d.ts.map | ||
export declare const typeIs: (value: string, ...types: string[]) => string | false; |
@@ -1,3 +0,3 @@ | ||
import { lookup } from "es-mime-types"; | ||
import * as typer from "es-content-type"; | ||
import * as typer from "@tinyhttp/content-type"; | ||
import mime from "mime"; | ||
function normalizeType(value) { | ||
@@ -26,4 +26,4 @@ const type = typer.parse(value); | ||
return false; | ||
if (expectedParts[1].substr(0, 2) === "*+") | ||
return expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length); | ||
if (expectedParts[1].slice(0, 2) === "*+") | ||
return expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length); | ||
if (expectedParts[1] !== "*" && expectedParts[1] !== actualParts[1]) | ||
@@ -44,3 +44,3 @@ return false; | ||
return "*/*" + type; | ||
return type.indexOf("/") === -1 ? lookup(type) : type; | ||
return type.indexOf("/") === -1 ? mime.getType(type) : type; | ||
} | ||
@@ -65,1 +65,2 @@ const typeIs = (value, ...types) => { | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tinyhttp/type-is", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"type": "module", | ||
@@ -31,4 +31,4 @@ "description": "TypeScript rewrite of type-is with CJS and ESM targets", | ||
"dependencies": { | ||
"es-content-type": "^0.1.0", | ||
"es-mime-types": "^0.1.4" | ||
"@tinyhttp/content-type": "^0.1.3", | ||
"mime": "4.0.0-beta.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
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
73
7961
7
+ Addedmime@4.0.0-beta.1
+ Added@tinyhttp/content-type@0.1.4(transitive)
+ Addedmime@4.0.0-beta.1(transitive)
- Removedes-content-type@^0.1.0
- Removedes-mime-types@^0.1.4
- Removedes-content-type@0.1.0(transitive)
- Removedes-mime-types@0.1.4(transitive)
- Removedmime-db@1.53.0(transitive)