Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliV committed Jul 11, 2022
1 parent 2f8f789 commit 5a33455
Show file tree
Hide file tree
Showing 4 changed files with 1,499 additions and 2,960 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'prettier',
'plugin:prettier/recommended',
],
parserOptions: {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@
"devDependencies": {
"@types/bytes": "3.1.0",
"@types/content-type": "1.1.3",
"@types/jest": "26.0.19",
"@types/jest": "28.1.4",
"@types/node": "13.9.1",
"@types/test-listen": "1.1.0",
"@typescript-eslint/eslint-plugin": "4.11.1",
"@typescript-eslint/parser": "4.11.1",
"@typescript-eslint/eslint-plugin": "5.30.5",
"@typescript-eslint/parser": "5.30.5",
"@vercel/ncc": "0.34.0",
"@zeit/fetch-retry": "4.0.1",
"@zeit/git-hooks": "0.1.4",
"@vercel/ncc": "0.33.2",
"bytes": "3.1.2",
"content-type": "1.0.4",
"eslint": "7.16.0",
"eslint-config-prettier": "7.1.0",
"eslint-plugin-prettier": "3.3.0",
"jest": "26.6.3",
"eslint": "8.19.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"jest": "28.1.2",
"node-fetch": "2.6.7",
"prettier": "2.2.1",
"raw-body": "2.4.2",
"prettier": "2.7.1",
"raw-body": "2.5.1",
"resumer": "0.0.0",
"test-listen": "1.1.0",
"ts-jest": "26.4.4",
"typescript": "4.5.5"
"ts-jest": "28.0.5",
"typescript": "4.7.4"
},
"dependencies": {
"handler-agent": "0.2.0"
Expand Down
20 changes: 9 additions & 11 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ type OnFunction<OptsType> = (
hndl: MicriHandler<OptsType>
) => [Predicate<OptsType>, MicriHandler<OptsType>];

const router = <OptsType = any>(...rest: [Predicate<OptsType>, MicriHandler<OptsType>][]): MicriHandler<OptsType> => (
req: IncomingMessage,
res: ServerResponse,
opts?: OptsType
): any =>
(rest.find((route) => route[0](req, res, opts)) || [
null,
(): void => {
throw Error('No matching route was found');
},
])[1](req, res, opts);
const router =
<OptsType = any>(...rest: [Predicate<OptsType>, MicriHandler<OptsType>][]): MicriHandler<OptsType> =>
(req: IncomingMessage, res: ServerResponse, opts?: OptsType): any =>
(rest.find((route) => route[0](req, res, opts)) || [
null,
(): void => {
throw Error('No matching route was found');
},
])[1](req, res, opts);

const onInit: { [index: string]: OnFunction<any> } = {};
const on = METHODS.map((method) => [
Expand Down
Loading

0 comments on commit 5a33455

Please sign in to comment.