Socket
Socket
Sign inDemoInstall

@tinyhttp/app

Package Overview
Dependencies
Maintainers
1
Versions
305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/app - npm Package Compare versions

Comparing version 1.3.14 to 1.3.15

23

dist/index.js

@@ -223,2 +223,3 @@ import { STATUS_CODES, createServer } from 'http';

use(...args) {
var _a;
const base = args[0];

@@ -254,2 +255,16 @@ const fns = args.slice(1).flat();

else {
const handlerPaths = [];
const handlerFunctions = [];
for (const fn of fns) {
if (fn instanceof App && ((_a = fn.middleware) === null || _a === void 0 ? void 0 : _a.length)) {
for (const mw of fn.middleware) {
handlerPaths.push(lead(base) + lead(mw.path));
handlerFunctions.push(fn);
}
}
else {
handlerPaths.push('');
handlerFunctions.push(fn);
}
}
pushMiddleware(this.middleware)({

@@ -259,7 +274,5 @@ path: base,

type: 'mw',
handler: mount(fns[0]),
handlers: fns.slice(1).map(mount),
fullPaths: fns
.flat()
.map((fn) => { var _a, _b; return fn instanceof App && ((_a = fn.middleware) === null || _a === void 0 ? void 0 : _a[0]) ? lead(base) + lead((_b = fn.middleware) === null || _b === void 0 ? void 0 : _b[0].path) : ''; })
handler: mount(handlerFunctions[0]),
handlers: handlerFunctions.slice(1).map(mount),
fullPaths: handlerPaths
});

@@ -266,0 +279,0 @@ }

{
"name": "@tinyhttp/app",
"version": "1.3.14",
"version": "1.3.15",
"description": "0-legacy, tiny & fast web framework as a replacement of Express",

@@ -47,3 +47,3 @@ "type": "module",

"@tinyhttp/req": "1.3.1",
"@tinyhttp/res": "1.3.2",
"@tinyhttp/res": "1.3.3",
"@tinyhttp/router": "1.3.3",

@@ -50,0 +50,0 @@ "regexparam": "^2.0.0"

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