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

@ot06/be-utils

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ot06/be-utils - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

44

dist/expressMiddlewares.js

@@ -7,7 +7,2 @@ 'use strict';

exports.default = void 0;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
var expressMiddlewares = {

@@ -19,28 +14,21 @@ asyncWrapper

function asyncWrapper(_x) {
return _asyncWrapper.apply(this, arguments);
}
function asyncWrapper(middleware) {
return (request, response, next) => {
if (response.body) {
return process.nextTick(next);
}
function _asyncWrapper() {
_asyncWrapper = _asyncToGenerator(function* (middleware) {
return (request, response, next) => {
if (response.body) {
return process.nextTick(next);
return Promise.resolve(middleware(request, response, next)).catch(error => {
var responseBody;
if (error.constructor.name === 'ResponseBody') {
response.body = error;
} else {
response.error = error;
}
return Promise.resolve(middleware(request, response, next)).catch(error => {
var responseBody;
if (error.constructor.name === 'ResponseBody') {
response.body = error;
} else {
response.error = error;
}
response.body = responseBody;
next();
});
};
});
return _asyncWrapper.apply(this, arguments);
response.body = responseBody;
next();
});
};
}
{
"name": "@ot06/be-utils",
"version": "0.0.5",
"version": "0.0.6",
"description": "Backend Utilities Module",

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

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