mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
[qs-middleware] Add initial types
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for qs-middleware 1.0
|
||||
// Project: https://github.com/springernature/qs-middleware
|
||||
// Definitions by: Dave Cardwell <https://github.com/davecardwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import express = require("express");
|
||||
import qs = require("qs");
|
||||
|
||||
declare function qsMiddleware(
|
||||
options?: qs.IParseOptions
|
||||
): express.RequestHandler;
|
||||
|
||||
export = qsMiddleware;
|
||||
@@ -0,0 +1,23 @@
|
||||
import express = require("express");
|
||||
import query = require("qs-middleware");
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(query());
|
||||
app.use(query({}));
|
||||
app.use(
|
||||
query({
|
||||
delimiter: "string",
|
||||
depth: 123,
|
||||
decoder: str => str.toLowerCase(),
|
||||
arrayLimit: 123,
|
||||
parseArrays: true,
|
||||
allowDots: true,
|
||||
plainObjects: true,
|
||||
allowPrototypes: true,
|
||||
parameterLimit: 123,
|
||||
strictNullHandling: true,
|
||||
ignoreQueryPrefix: true
|
||||
})
|
||||
);
|
||||
app.use(query({ delimiter: /regexp/ }));
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "qs-middleware-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user