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

express-response-formatter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-response-formatter - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

usage.gif

6

CHANGELOG.md

@@ -8,2 +8,8 @@ # Changelog

## [2.0.2] - 2020-08-12
### Added
- Add auto complete for TypeScript.
## [2.0.1] - 2020-08-11

@@ -10,0 +16,0 @@

11

lib/index.d.ts
import { Request, Response, NextFunction } from 'express';
interface LooseObject {
[key: string]: any;
}
import { Methods } from './methods';
declare type ResponseFunction = {
[key in Methods]: (data: any, meta?: any) => void;
};
declare global {
namespace Express {
interface Response {
formatter: LooseObject;
formatter: ResponseFunction;
}
}
}
declare const responseEnhancer: () => (req: Request<import("express-serve-static-core").ParamsDictionary>, res: Response<any>, next: NextFunction) => void;
declare const responseEnhancer: () => (req: Request, res: Response, next: NextFunction) => void;
export { responseEnhancer };

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.responseEnhancer = void 0;
var methods_1 = __importDefault(require("./methods"));

@@ -8,0 +9,0 @@ var responseEnhancer = function () { return function (req, res, next) {

@@ -0,3 +1,4 @@

declare type Methods = 'ok' | 'created' | 'accepted' | 'noContent' | 'badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'methodNotAllowed' | 'timeout' | 'conflict' | 'unprocess' | 'tooManyRequests' | 'serverError' | 'badGateway' | 'serviceUnavailable' | 'gatewayTimeout';
interface Method {
name: string;
name: Methods;
code: string;

@@ -8,3 +9,3 @@ message: string;

declare const methods: Method[];
export { Method };
export { Method, Methods };
export default methods;
{
"name": "express-response-formatter",
"version": "2.0.1",
"version": "2.0.2",
"main": "lib/index.js",

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

@@ -15,2 +15,4 @@ # express-response-formatter

![Usage](usage.gif)
## Installation

@@ -17,0 +19,0 @@

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