Socket
Book a DemoSign in
Socket

@types/body-parser

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/body-parser - npm Package Compare versions

Comparing version
1.19.1
to
1.19.2
+30
-27
body-parser/index.d.ts

@@ -19,8 +19,31 @@ // Type definitions for body-parser 1.19

/** @deprecated */
declare function bodyParser(
options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded,
): NextHandleFunction;
declare namespace bodyParser {
interface BodyParser {
/**
* @deprecated use individual json/urlencoded middlewares
*/
(options?: OptionsJson & OptionsText & OptionsUrlencoded): NextHandleFunction;
/**
* Returns middleware that only parses json and only looks at requests
* where the Content-Type header matches the type option.
*/
json(options?: OptionsJson): NextHandleFunction;
/**
* Returns middleware that parses all bodies as a Buffer and only looks at requests
* where the Content-Type header matches the type option.
*/
raw(options?: Options): NextHandleFunction;
declare namespace bodyParser {
/**
* Returns middleware that parses all bodies as a string and only looks at requests
* where the Content-Type header matches the type option.
*/
text(options?: OptionsText): NextHandleFunction;
/**
* Returns middleware that only parses urlencoded bodies and only looks at requests
* where the Content-Type header matches the type option
*/
urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
}
interface Options {

@@ -81,26 +104,6 @@ /** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */

}
}
/**
* Returns middleware that only parses json and only looks at requests
* where the Content-Type header matches the type option.
*/
function json(options?: OptionsJson): NextHandleFunction;
/**
* Returns middleware that parses all bodies as a Buffer and only looks at requests
* where the Content-Type header matches the type option.
*/
function raw(options?: Options): NextHandleFunction;
declare const bodyParser: bodyParser.BodyParser;
/**
* Returns middleware that parses all bodies as a string and only looks at requests
* where the Content-Type header matches the type option.
*/
function text(options?: OptionsText): NextHandleFunction;
/**
* Returns middleware that only parses urlencoded bodies and only looks at requests
* where the Content-Type header matches the type option
*/
function urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
}
export = bodyParser;
{
"name": "@types/body-parser",
"version": "1.19.1",
"version": "1.19.2",
"description": "TypeScript definitions for body-parser",

@@ -56,4 +56,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser",

},
"typesPublisherContentHash": "390273f9d955dbe97cc87b88bf69634aeb1b9f82e6eafa68118b286638113100",
"typeScriptVersion": "3.6"
"typesPublisherContentHash": "ad069aa8b9e8a95f66df025de11975c773540e4071000abdb7db565579b013ee",
"typeScriptVersion": "3.7"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Tue, 06 Jul 2021 18:05:43 GMT
* Last updated: Tue, 16 Nov 2021 18:31:30 GMT
* Dependencies: [@types/connect](https://npmjs.com/package/@types/connect), [@types/node](https://npmjs.com/package/@types/node)

@@ -14,0 +14,0 @@ * Global values: none