Skip to content

Commit 5f66353

Browse files
Add a HasContent type for withContent usage convenience (#188)
* Add a HasContent type for withContent usage convenience * Spacing :) --------- Co-authored-by: Kevin R. Whitley <krwhitley@gmail.com>
1 parent 5f9ff06 commit 5f66353

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,7 @@ dist
110110
docs/dist
111111
docs/dist-ssr
112112
docs/*.local
113-
docs/pages/README.md
113+
docs/pages/README.md
114+
115+
# JetBrains tools
116+
.idea

src/withContent.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { IRequest } from './Router'
1+
import { IRequest, IRequestStrict } from './Router'
2+
3+
export type HasContent<ContentType> = {
4+
content: ContentType,
5+
} & IRequestStrict
26

37
// withContent - embeds any request body as request.content
48
export const withContent = async (request: IRequest): Promise<void> => {

0 commit comments

Comments
 (0)