Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/content-disposition

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/content-disposition - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

dist/index.js.map

5

dist/index.d.ts

@@ -18,5 +18,4 @@ export declare class ContentDisposition {

* Parse Content-Disposition header string.
* @param string string
* @param header string
*/
export declare function parse(string: string): ContentDisposition;
//# sourceMappingURL=index.d.ts.map
export declare function parse(header: string): ContentDisposition;

15

dist/index.js

@@ -40,3 +40,3 @@ const ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;

for (const param of params) {
const val = param.substr(-1) === "*" ? ustring(parameters[param]) : qstring(parameters[param]);
const val = param.slice(-1) === "*" ? ustring(parameters[param]) : qstring(parameters[param]);
string += "; " + param + "=" + val;

@@ -95,4 +95,4 @@ }

}
function parse(string) {
let match = DISPOSITION_TYPE_REGEXP.exec(string);
function parse(header) {
let match = DISPOSITION_TYPE_REGEXP.exec(header);
if (!match)

@@ -106,4 +106,4 @@ throw new TypeError("invalid type format");

let value;
index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ";" ? index - 1 : index;
while (match = PARAM_REGEXP.exec(string)) {
index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ";" ? index - 1 : index;
while (match = PARAM_REGEXP.exec(header)) {
if (match.index !== index)

@@ -127,7 +127,7 @@ throw new TypeError("invalid parameter format");

if (value[0] === '"') {
value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1");
value = value.slice(1, value.length - 1).replace(QESC_REGEXP, "$1");
}
params[key] = value;
}
if (index !== -1 && index !== string.length) {
if (index !== -1 && index !== header.length) {
throw new TypeError("invalid parameter format");

@@ -142,1 +142,2 @@ }

};
//# sourceMappingURL=index.js.map
{
"name": "@tinyhttp/content-disposition",
"description": "content-disposition rewrite in TypeScript",
"version": "2.1.0",
"version": "2.2.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://tinyhttp.v1rtl.site",

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