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

@hattip/compose

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hattip/compose - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

23

dist/index.js

@@ -8,11 +8,2 @@ // src/index.ts

const flatHandlers = handlers.flat().filter(Boolean);
flatHandlers.unshift((context) => {
context.url = new URL(context.request.url);
context.method = context.request.method;
context.locals = {};
context.handleError = (error) => {
console.error(error);
return new Response("Internal Server Error", { status: 500 });
};
});
return flatHandlers.map(wrap).reduceRight((prev, current) => {

@@ -27,3 +18,15 @@ return async (context) => {

function compose(...handlers) {
return composePartial([...handlers, finalHandler]);
return composePartial([
(context) => {
context.url = new URL(context.request.url);
context.method = context.request.method;
context.locals = {};
context.handleError = (error) => {
console.error(error);
return new Response("Internal Server Error", { status: 500 });
};
},
...handlers,
finalHandler
]);
}

@@ -30,0 +33,0 @@ function wrap(handler) {

{
"name": "@hattip/compose",
"version": "0.0.16",
"version": "0.0.17",
"type": "module",

@@ -12,3 +12,3 @@ "description": "Middleware system for HatTip",

"dependencies": {
"@hattip/core": "0.0.16"
"@hattip/core": "0.0.17"
},

@@ -15,0 +15,0 @@ "devDependencies": {

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