Socket
Socket
Sign inDemoInstall

@tinyhttp/type-is

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/type-is - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

dist/index.js.map

3

dist/index.d.ts

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc