import { CallHandler , ExecutionContext , Injectable , NestInterceptor , } from '@nestjs/common' ; import { map } from 'rxjs/operators' ; import { Observable } from 'rxjs' ; @ Injectable ( ) export class TransformInterceptor implements NestInterceptor { intercept ( context , next ) { return next . handle ( ) . pipe ( map ( x => ( { transformed : x } ) ) ) ; } }