Socket
Socket
Sign inDemoInstall

@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 1.2.1 to 1.2.2

13

dist/index.js

@@ -35,5 +35,3 @@ import { basename } from 'path';

}
function format(obj) {
const parameters = obj.parameters;
const type = obj.type;
function format({ parameters, type }) {
if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type))

@@ -60,4 +58,2 @@ throw new TypeError('invalid type');

fallback = true;
if (typeof fallback !== 'string' && typeof fallback !== 'boolean')
throw new TypeError('fallback must be a string or boolean');
if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback))

@@ -87,6 +83,5 @@ throw new TypeError('fallback must be ISO-8859-1 string');

*/
function contentDisposition(filename, options) {
const opts = options || {};
function contentDisposition(filename, options = {}) {
// format into string
return format(new ContentDisposition(opts.type || 'attachment', createParams(filename, opts.fallback)));
return format(new ContentDisposition(options.type || 'attachment', createParams(filename, options.fallback)));
}

@@ -119,4 +114,2 @@ function decodefield(str) {

function parse(string) {
if (!string || typeof string !== 'string')
throw new TypeError('argument string is required');
let match = DISPOSITION_TYPE_REGEXP.exec(string);

@@ -123,0 +116,0 @@ if (!match)

{
"name": "@tinyhttp/content-disposition",
"description": "content-disposition rewrite in TypeScript with ESM and CommonJS targets",
"version": "1.2.1",
"version": "1.2.2",
"homepage": "https://tinyhttp.v1rtl.site",

@@ -6,0 +6,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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