Skip to content

Commit

Permalink
Replaces the "unknown" generic with "any"
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Sep 12, 2020
1 parent db6f22c commit 81da2b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Headers } from 'headers-utils'
import { compose } from './utils/internal/compose'
import { NetworkError } from './utils/NetworkError'

export interface MockedResponse<BodyType = unknown> {
export interface MockedResponse<BodyType = any> {
body: BodyType
status: number
statusText: string
Expand All @@ -11,15 +11,13 @@ export interface MockedResponse<BodyType = unknown> {
delay?: number
}

export type ResponseTransformer<BodyType = unknown> = (
export type ResponseTransformer<BodyType = any> = (
res: MockedResponse<BodyType>,
) => MockedResponse<BodyType>
type ResponseFunction<BodyType = any> = (
...transformers: ResponseTransformer<BodyType>[]
) => MockedResponse<BodyType>
export type ResponseComposition<BodyType = unknown> = ResponseFunction<
BodyType
> & {
export type ResponseComposition<BodyType = any> = ResponseFunction<BodyType> & {
/**
* Respond using a given mocked response to the first captured request.
* Does not affect any subsequent captured requests.
Expand Down
2 changes: 1 addition & 1 deletion src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface ParsedRestRequest {
}

const createRestHandler = (method: RESTMethods) => {
return <RequestBodyType = DefaultRequestBodyType, ResponseBodyType = unknown>(
return <RequestBodyType = DefaultRequestBodyType, ResponseBodyType = any>(
mask: Mask,
resolver: ResponseResolver<
MockedRequest<RequestBodyType>,
Expand Down

0 comments on commit 81da2b9

Please sign in to comment.