Skip to content

Commit

Permalink
Spacing :)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhitley authored Oct 28, 2023
1 parent 34462d8 commit 1cf1303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/withContent.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {IRequest, IRequestStrict} from './Router'
import { IRequest, IRequestStrict } from './Router'

export type HasContent<ContentType> = {
content: ContentType,
} & IRequestStrict

// withContent - embeds any request body as request.content
export const withContent = async (request: IRequest): Promise<void> => {
if (request.headers.get('content-type')?.includes('json'))
request.content = await request.json()
}

export type HasContent<ContentType> = {
content: ContentType,
} & IRequestStrict

0 comments on commit 1cf1303

Please sign in to comment.