Fix initialisation
This commit is contained in:
parent
f06d0a5cd6
commit
1c69cfaeda
|
@ -6,7 +6,7 @@ function validate(
|
||||||
property: string,
|
property: string,
|
||||||
opts?: { errorPrefix?: string; allowUnknown?: boolean }
|
opts?: { errorPrefix?: string; allowUnknown?: boolean }
|
||||||
) {
|
) {
|
||||||
const errorPrefix = opts?.errorPrefix || `Invalid ${property}`
|
const errorPrefix = opts?.errorPrefix ?? `Invalid ${property}`
|
||||||
// Return a Koa middleware function
|
// Return a Koa middleware function
|
||||||
return (ctx: Ctx, next: any) => {
|
return (ctx: Ctx, next: any) => {
|
||||||
if (!schema) {
|
if (!schema) {
|
||||||
|
|
Loading…
Reference in New Issue