Documents / @faasjs/http / Validator
Class: Validator<TParams, TCookie, TSession>
Deprecated
Type Parameters
• TParams extends Record
<string
, any
> = any
• TCookie extends Record
<string
, string
> = any
• TSession extends Record
<string
, string
> = any
Constructors
new Validator()
new Validator<
TParams
,TCookie
,TSession
>(config
):Validator
<TParams
,TCookie
,TSession
>
Parameters
• config: ValidatorConfig
<TParams
, TCookie
, TSession
>
Returns
Validator
<TParams
, TCookie
, TSession
>
Methods
valid()
valid(
request
,logger
):Promise
<void
>
Parameters
• request: Request
<TParams
, TCookie
, TSession
>
• logger: Logger
Returns
Promise
<void
>
validContent()
validContent(
type
,params
,baseKey
,config
,logger
):void
Parameters
• type: string
• params
• baseKey: string
• config: ValidatorOptions
<Record
<string
, any
>>
• logger: Logger
Returns
void
Properties
before?
optional
before:BeforeOption
<TParams
,TCookie
,TSession
>
cookieConfig?
optional
cookieConfig:ValidatorOptions
<TCookie
>
paramsConfig?
optional
paramsConfig:ValidatorOptions
<TParams
>
sessionConfig?
optional
sessionConfig:ValidatorOptions
<TSession
>