Skip to content

Commit

Permalink
fix: lint erros
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihar committed Sep 17, 2024
1 parent fbc6168 commit 9b28ecf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api-gateway/src/helpers/interceptors/cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable, NestInterceptor, ExecutionContext, CallHandler, HttpException, HttpStatus, StreamableFile } from '@nestjs/common';

import { Readable } from 'stream';
import { Observable, of, switchMap, tap } from 'rxjs';

//services
Expand Down Expand Up @@ -53,7 +52,7 @@ export class CacheInterceptor implements NestInterceptor {
let result = JSON.parse(cachedResponse);

if (result.type === 'StreamableFile') {
let buffer = Buffer.from(result.data, 'base64');
const buffer = Buffer.from(result.data, 'base64');
result = new StreamableFile(buffer);
}
else if (result.type === 'buffer') {
Expand Down Expand Up @@ -83,7 +82,7 @@ export class CacheInterceptor implements NestInterceptor {
}

if (response instanceof StreamableFile) {
let buffer = await streamToBuffer(response.getStream());
const buffer = await streamToBuffer(response.getStream());
result = { type: 'StreamableFile', data: buffer.toString('base64') };
}
else if (Buffer.isBuffer(result)) {
Expand Down

0 comments on commit 9b28ecf

Please sign in to comment.