Socket
Socket
Sign inDemoInstall

@kamalyb/express-list-routes

Package Overview
Dependencies
63
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.9 to 1.1.10

4

dist/index.d.ts

@@ -1,2 +0,2 @@

import { Express } from "express";
import { Router } from "express";
export interface Options {

@@ -6,3 +6,3 @@ prefix: string;

}
declare function expressListRoutes(app: Express, opts?: Options): void;
declare function expressListRoutes(router: Router, opts?: Options): void;
export default expressListRoutes;

@@ -68,22 +68,13 @@ "use strict";

}
function getStacks(app) {
// Express 3
if (app.routes) {
// convert to express 4
return Object.keys(app.routes)
.reduce(function (acc, method) { return __spreadArray(__spreadArray([], acc, true), app.routes[method], true); }, [])
.map(function (route) { return ({ route: { stack: [route] } }); });
function getStacks(router) {
if (router.stack) {
return router.stack.reduce(combineStacks, []);
}
// Express 4
if (app._router && app._router.stack) {
return app._router.stack.reduce(combineStacks, []);
if (router.stack) {
return router.stack.reduce(combineStacks, []);
}
// Express 4 Router
if (app.stack) {
return app.stack.reduce(combineStacks, []);
}
return [];
}
function expressListRoutes(app, opts) {
var stacks = getStacks(app);
function expressListRoutes(router, opts) {
var stacks = getStacks(router);
var options = __assign(__assign({}, defaultOptions), (opts !== null && opts !== void 0 ? opts : {}));

@@ -90,0 +81,0 @@ for (var _i = 0, stacks_1 = stacks; _i < stacks_1.length; _i++) {

{
"name": "@kamalyb/express-list-routes",
"version": "1.1.9",
"version": "1.1.10",
"description": "Typescript'd fork of express-list-routes",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc