Comparing version 2.0.5 to 2.0.6
@@ -5,5 +5,8 @@ import { Context, Middleware } from "koa"; | ||
import { ObjectShape } from "yup/lib/object"; | ||
declare type RecursivePartial<T> = { | ||
[P in keyof T]?: RecursivePartial<T[P]>; | ||
}; | ||
export declare type ExtendedContext<RequestBody extends ObjectShape | null = null, QueryParams = Record<string, string | undefined>> = Context & { | ||
request: Context["request"] & { | ||
body: RequestBody extends ObjectShape ? ObjectSchema<RequestBody>["__outputType"] : null; | ||
body: RequestBody extends ObjectShape ? RecursivePartial<ObjectSchema<RequestBody>["__outputType"]> : null; | ||
}; | ||
@@ -31,1 +34,2 @@ params: QueryParams; | ||
export declare type PUT<ResponseBody = null, RequestBody extends ObjectShape | null = null> = HTTPMethod<"put", ResponseBody, RequestBody>; | ||
export {}; |
@@ -6,2 +6,6 @@ import { Context, Middleware } from "koa"; | ||
type RecursivePartial<T> = { | ||
[P in keyof T]?: RecursivePartial<T[P]>; | ||
}; | ||
export type ExtendedContext< | ||
@@ -13,3 +17,3 @@ RequestBody extends ObjectShape | null = null, | ||
body: RequestBody extends ObjectShape | ||
? ObjectSchema<RequestBody>["__outputType"] | ||
? RecursivePartial<ObjectSchema<RequestBody>["__outputType"]> | ||
: null; | ||
@@ -16,0 +20,0 @@ }; |
{ | ||
"name": "18h", | ||
"description": "A Next.js style dynamic API router for Koa-based APIs.", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "url": "https://github.com/ridafkih/18h" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29663
653