Socket
Socket
Sign inDemoInstall

express-router-api

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-router-api - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

5

index.js

@@ -68,4 +68,2 @@ 'use strict';

return (req, res, next) => {
let returnValue = origHandler(req, res, next);
let apiErrorHandler = err => {

@@ -76,3 +74,4 @@ res.status(err.statusCode || 500).json(err.message);

Promise.resolve().then(() => {
Promise.resolve().then(() => origHandler(req, res, next))
.then((returnValue) => {
if(typeof returnValue === 'undefined' && index === callbacks.length - 1) {

@@ -79,0 +78,0 @@ throw new ExpressApiRouterError('Route for ' + path.toString() + ' did not return a promise');

2

package.json
{
"name": "express-router-api",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -156,2 +156,12 @@ 'use strict';

routeTest((req, res) => {
throw new ApiError({error: 'test'}, 403);
});
return requestTest({
error: 'test'
}, 403)
});
it('should support reporting JSON errors from promise', () => {
routeTest((req, res) => {
return Promise.delay(10).then(() => {

@@ -158,0 +168,0 @@ throw new ApiError({error: 'test'}, 403);

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