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

async-app

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-app - npm Package Compare versions

Comparing version 4.2.0 to 4.3.0

custom-response.d.ts

22

async.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const custom_response_1 = require("./custom-response");
const error_1 = require("./error");

@@ -24,3 +25,3 @@ const types_1 = require("./types");

const isAsync = types_1.isAsyncMiddleware(middleware);
const val = options.mapAsyncResultFn
const mappedVal = options.mapAsyncResultFn
? await options.mapAsyncResultFn(result, {

@@ -32,2 +33,10 @@ isAsyncMiddleware: isAsync,

: result;
let val = mappedVal;
let isRaw = false;
let headers;
if (mappedVal instanceof custom_response_1.CustomResponse) {
val = mappedVal.value;
isRaw = mappedVal.isRaw;
headers = mappedVal.headers;
}
if (!isAsync) {

@@ -60,3 +69,12 @@ // This middleware has `res` so we it will take care of the response

}
res.status(options.statusCode).json(val || {});
if (headers) {
res.set(headers);
}
res.status(options.statusCode);
if (isRaw) {
res.send(val);
}
else {
res.json(val || {});
}
}

@@ -63,0 +81,0 @@ catch (err) {

2

package.json
{
"name": "async-app",
"version": "4.2.0",
"version": "4.3.0",
"description": "An express wrapper for handling async middlewares, order middlewares, schema validator, and other stuff",

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

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