Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
style: clean up some type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
adieuadieu committed Sep 13, 2018
1 parent 9300e0a commit 3fe5571
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/response/make-response-object.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { InterfaceResponseData } from '../types'
import { InterfaceResponseData, InterfaceResponseOptions } from '../types'

export default function makeResponseObject(
body: string,
statusCode: number = 200,
{ headers = {}, ...options } = {},
statusCode = 200,
{ headers = {}, ...options }: InterfaceResponseOptions = {},
contentType?: string,
): InterfaceResponseData {
return Object.freeze({
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const mockRequestContext: AWSLambda.APIGatewayEventRequestContext = {
accessKey: null,
accountId: null,
apiKey: null,
apiKeyId: null,
caller: null,
cognitoAuthenticationProvider: null,
cognitoAuthenticationType: null,
Expand All @@ -33,6 +34,7 @@ export const mockRequestContext: AWSLambda.APIGatewayEventRequestContext = {
userAgent: 'foobar',
userArn: null,
},
path: '/',
requestId: 'foobar',
requestTimeEpoch: 0,
resourceId: 'foobar',
Expand All @@ -47,12 +49,16 @@ export const get: InterfaceRequest = {
headers: {},
httpMethod: 'GET',
isBase64Encoded: false,
meta: {},
method: 'GET',
path: '/',
pathParameters: {},
provider: 'aws',
query: {},
queryStringParameters: {},
requestContext: mockRequestContext,
resource: 'foobar',
source: 'aws',
stageVariables: {},
timestamp: Date.now(),
}

0 comments on commit 3fe5571

Please sign in to comment.