Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 5x 56x 48x 8x 8x | import { ExecutionContext } from '@nestjs/common'; export function getContextObject(context: ExecutionContext): any { switch (context.getType() as string) { case 'http': return context.switchToHttp().getRequest(); case 'graphql': const [, , ctx] = context.getArgs(); return ctx; case 'rpc': return context.switchToRpc().getContext(); default: console.warn(`context type: ${context.getType()} not supported`); } } |