@tinyhttp/content-disposition
Advanced tools
Comparing version 0.5.4 to 0.5.5
# @tinyhttp/content-disposition | ||
## 0.5.5 | ||
### Patch Changes | ||
- bump | ||
## 0.5.4 | ||
@@ -4,0 +10,0 @@ |
@@ -80,5 +80,3 @@ import { basename } from 'path'; | ||
} | ||
function pdecode(_str, hex) { | ||
return String.fromCharCode(parseInt(hex, 16)); | ||
} | ||
const pdecode = (_str, hex) => String.fromCharCode(parseInt(hex, 16)); | ||
/** | ||
@@ -92,14 +90,9 @@ * Create an attachment Content-Disposition header. | ||
const opts = options || {}; | ||
// get type | ||
const type = opts.type || 'attachment'; | ||
// get parameters | ||
const params = createParams(filename, opts.fallback); | ||
// format into string | ||
return format(new ContentDisposition(type, params)); | ||
return format(new ContentDisposition(opts.type || 'attachment', createParams(filename, opts.fallback))); | ||
} | ||
function decodefield(str) { | ||
const match = EXT_VALUE_REGEXP.exec(str); | ||
if (!match) { | ||
if (!match) | ||
throw new TypeError('invalid extended field value'); | ||
} | ||
const charset = match[1].toLowerCase(); | ||
@@ -143,11 +136,9 @@ const encoded = match[2]; | ||
while ((match = PARAM_REGEXP.exec(string))) { | ||
if (match.index !== index) { | ||
if (match.index !== index) | ||
throw new TypeError('invalid parameter format'); | ||
} | ||
index += match[0].length; | ||
key = match[1].toLowerCase(); | ||
value = match[2]; | ||
if (names.indexOf(key) !== -1) { | ||
if (names.indexOf(key) !== -1) | ||
throw new TypeError('invalid duplicate parameter'); | ||
} | ||
names.push(key); | ||
@@ -154,0 +145,0 @@ if (key.indexOf('*') + 1 === key.length) { |
{ | ||
"name": "@tinyhttp/content-disposition", | ||
"description": "content-disposition rewrite in TypeScript with ESM and CommonJS targets", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"homepage": "https://github.com/talentlessguy/tinyhttp#readme", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
26457
508