( req: NextIncomingMessage, key?: K )
| 353 | key: K |
| 354 | ): RequestMeta[K] |
| 355 | export function getRequestMeta<K extends keyof RequestMeta>( |
| 356 | req: NextIncomingMessage, |
| 357 | key?: K |
| 358 | ): RequestMeta | RequestMeta[K] { |
| 359 | const meta = req[NEXT_REQUEST_META] || {} |
| 360 | return typeof key === 'string' ? meta[key] : meta |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Sets the request metadata. |
no outgoing calls
no test coverage detected