@tinyhttp/content-disposition
Advanced tools
Comparing version 0.5.3 to 0.5.4
# @tinyhttp/content-disposition | ||
## 0.5.4 | ||
### Patch Changes | ||
- Strip some bytes | ||
## 0.5.3 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@tinyhttp/content-disposition", | ||
"description": "content-disposition rewrite in TypeScript with ESM and CommonJS targets", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"homepage": "https://github.com/talentlessguy/tinyhttp#readme", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -117,5 +117,3 @@ import { basename } from 'path' | ||
function pdecode(_str: string, hex: string) { | ||
return String.fromCharCode(parseInt(hex, 16)) | ||
} | ||
const pdecode = (_str: string, hex: string) => String.fromCharCode(parseInt(hex, 16)) | ||
@@ -138,10 +136,4 @@ /** | ||
// 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))) | ||
} | ||
@@ -152,5 +144,3 @@ | ||
if (!match) { | ||
throw new TypeError('invalid extended field value') | ||
} | ||
if (!match) throw new TypeError('invalid extended field value') | ||
@@ -203,5 +193,3 @@ const charset = match[1].toLowerCase() | ||
while ((match = PARAM_REGEXP.exec(string))) { | ||
if (match.index !== index) { | ||
throw new TypeError('invalid parameter format') | ||
} | ||
if (match.index !== index) throw new TypeError('invalid parameter format') | ||
@@ -212,5 +200,3 @@ index += match[0].length | ||
if (names.indexOf(key) !== -1) { | ||
throw new TypeError('invalid duplicate parameter') | ||
} | ||
if (names.indexOf(key) !== -1) throw new TypeError('invalid duplicate parameter') | ||
@@ -217,0 +203,0 @@ names.push(key) |
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
26702
526