Socket
Socket
Sign inDemoInstall

@tinyhttp/res

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/res - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

dist/append.d.ts

6

CHANGELOG.md
# @tinyhttp/res
## 0.4.6
### Patch Changes
- Forgot to bump
## 0.4.5

@@ -4,0 +10,0 @@

1

dist/index.d.ts

@@ -8,1 +8,2 @@ export * from '@tinyhttp/send';

export * from './download';
export * from './append';

@@ -215,2 +215,13 @@ import { sendFile } from '@tinyhttp/send';

export { attachment, clearCookie, download, formatResponse, getResponseHeader, redirect, setContentType, setCookie, setHeader, setLinksHeader, setLocationHeader, setVaryHeader };
const append = (_req, res) => (field, value) => {
const prevVal = res.getHeader(field);
let newVal = value;
// additional type checks for typescript to not throw errors
if (prevVal && typeof newVal !== 'number' && typeof prevVal !== 'number') {
newVal = Array.isArray(prevVal) ? prevVal.concat(newVal) : Array.isArray(newVal) ? [prevVal].concat(newVal) : [prevVal, newVal];
}
res.setHeader(field, newVal);
return res;
};
export { append, attachment, clearCookie, download, formatResponse, getResponseHeader, redirect, setContentType, setCookie, setHeader, setLinksHeader, setLocationHeader, setVaryHeader };

2

package.json
{
"name": "@tinyhttp/res",
"version": "0.4.5",
"version": "0.4.6",
"type": "module",

@@ -5,0 +5,0 @@ "description": "response extensions for tinyhttp",

@@ -8,1 +8,2 @@ export * from '@tinyhttp/send'

export * from './download'
export * from './append'

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