Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Update typings
Browse files Browse the repository at this point in the history
  • Loading branch information
onechiporenko committed Dec 3, 2018
1 parent 87ffa7b commit 8cba90c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CRUDOptions } from 'lair-db/dist/lair';
import methods = require('methods');
import { assert } from './utils';

function defaultNext(req: express.Request, res: express.Response, data: object|void): express.Response {
function defaultNext(req: express.Request, res: express.Response, data: object[] | object | any): express.Response {
return res.json(data);
}

Expand All @@ -13,7 +13,7 @@ function defaultHandler(req: express.Request, res: express.Response, next: expre
}

export type Handler = (req: express.Request, res: express.Response, next: express.NextFunction, lair: Lair) => any;
export type CustomNext = (req: express.Request, res: express.Response, data: object|void, lair: Lair) => any;
export type CustomNext = (req: express.Request, res: express.Response, data: object[] | object | any, lair: Lair) => any;

export default class Route {
public static createRoute(method: string = 'get', path: string = '/', handler: Handler = defaultHandler): Route {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swarm-host",
"version": "1.5.1",
"version": "1.5.2",
"description": "fake-server",
"main": "dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down
Empty file modified publish.sh
100644 → 100755
Empty file.

0 comments on commit 8cba90c

Please sign in to comment.