Function getSingleQueryParam
- getSingleQueryParam<T>(query, key, pred): T | undefined
Parameters
- query: ParsedUrlQuery
- key: string
- pred: ((s: string) => s is T)
- (s): s is T
Returns s is T
Returns T | undefined
- getSingleQueryParam(query, key, pred?): string | undefined
Parameters
- query: ParsedUrlQuery
- key: string
Optional
pred: ((s: string) => boolean)- (s): boolean
Returns boolean
Returns string | undefined
Returns the first value for the specified key in the query object. If
pred
specified, returns the first value that meets it.返り値は、指定した
key
に対応するパラメータのうち最初の値。 もしpred
が指定されている場合は、その関数に合格した値のうち最初のものが返る。Example
Param: pred
optional. the first value that fits this predicate will be returned.