New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

routes-utility

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routes-utility - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

6

dist/index.d.ts

@@ -12,4 +12,4 @@ /// <reference types="when" />

}
export interface IProgression {
lastExecutedController: string;
export interface IProgression<C> {
lastExecutedController: C;
nextIndex: number;

@@ -48,3 +48,3 @@ routeSize: number;

addController(controller: Controller<CONTEXT, INIT_REQ, any, any, FINAL_RES>): this;
match(req: INIT_REQ, context: CONTEXT, onProgress?: (progression: IProgression) => any): When.Promise<FINAL_RES>;
match(req: INIT_REQ, context: CONTEXT, onProgress?: (progression: IProgression<Controller<CONTEXT, INIT_REQ, any, any, FINAL_RES>>) => any): When.Promise<FINAL_RES>;
readonly name: string;

@@ -51,0 +51,0 @@ readonly statistics: IRouteStatistics;

@@ -50,3 +50,3 @@ "use strict";

throw new sw_logger_1.CustomError("invalidRoute", "route %s does not contain any controller", this._name);
let index = 0, currentController = this._controllers[index], lastExecutedController, onProgressFns = [], def = When.defer(), finish = (res) => {
let index = 0, currentController = this._controllers[index], lastExecutedController, def = When.defer(), finish = (res) => {
if (_.isFinite(this._statistics.PENDING.STAGES[lastExecutedController.name]))

@@ -62,4 +62,2 @@ this._statistics.PENDING.STAGES[lastExecutedController.name]--;

};
if (onProgress != void 0)
onProgressFns.push(onProgress);
this._statistics.PENDING.TOTAL++;

@@ -90,11 +88,12 @@ let next = (res, controller) => {

this._statistics.PENDING.STAGES[currentController.name]++;
When.all(_.map(onProgressFns, (pFn) => {
return pFn({
lastExecutedController: lastExecutedController,
nextIndex: index,
routeSize: this._controllers.length,
req: req,
res: res
});
})).then(() => {
When(null).then(() => {
if (_.isFunction(onProgress))
return onProgress({
lastExecutedController: lastExecutedController,
nextIndex: index,
routeSize: this._controllers.length,
req: req,
res: res
});
}).then(() => {
lastExecutedController = currentController;

@@ -101,0 +100,0 @@ currentController.body.call(context, req, res, next, finish);

@@ -7,3 +7,3 @@ {

},
"version": "2.0.0",
"version": "2.0.1",
"scripts": {

@@ -10,0 +10,0 @@ "test": "./node_modules/.bin/mocha --opts tests/mocha.opts tests/**/*.ts",

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