Skip to content

Commit

Permalink
Merge pull request #1043 from chouandy/hotfix/update-http-router-meth…
Browse files Browse the repository at this point in the history
…od-type-to-inline

feat: update http-router Method to inline allowed values
  • Loading branch information
willfarrell authored Apr 17, 2023
2 parents d3cfb78 + 57defd2 commit 6d62e71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions packages/http-router/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ import {
Handler as LambdaHandler
} from 'aws-lambda'

export enum Method {
Get = 'GET',
Post = 'POST',
Put = 'PUT',
Patch = 'PATCH',
Delete = 'DELETE',
Options = 'OPTIONS',
Head = 'HEAD',
Any = 'ANY'
}
export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'ANY'

type TResult = ALBResult | APIGatewayProxyResult

Expand Down
4 changes: 2 additions & 2 deletions packages/http-router/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expectType } from 'tsd'
import middy from '@middy/core'
import httpRouterHandler, { Method } from '.'
import httpRouterHandler from '.'
import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Expand All @@ -16,7 +16,7 @@ const lambdaHandler: LambdaHandler<APIGatewayProxyEvent, APIGatewayProxyResult>

const middleware = httpRouterHandler([
{
method: Method.Get,
method: 'GET',
path: '/',
handler: lambdaHandler
}
Expand Down

0 comments on commit 6d62e71

Please sign in to comment.