refactor: organize imports and enhance formatting across backend files
Optimized import order, applied consistent formatting, and improved readability in various modules, including `contents`, `media`, and `auth` services.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { readFile, unlink, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { Readable } from "node:stream";
|
||||
import {
|
||||
BadRequestException,
|
||||
Injectable,
|
||||
@@ -7,10 +11,6 @@ import {
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import * as NodeClam from "clamscan";
|
||||
import ffmpeg from "fluent-ffmpeg";
|
||||
import { readFile, unlink, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { Readable } from "node:stream";
|
||||
import sharp from "sharp";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import type {
|
||||
@@ -19,7 +19,9 @@ import type {
|
||||
} from "./interfaces/media.interface";
|
||||
|
||||
interface ClamScanner {
|
||||
scanStream(stream: Readable): Promise<{ isInfected: boolean; viruses: string[] }>;
|
||||
scanStream(
|
||||
stream: Readable,
|
||||
): Promise<{ isInfected: boolean; viruses: string[] }>;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@@ -34,7 +36,7 @@ export class MediaService {
|
||||
|
||||
private async initClamScan() {
|
||||
try {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const scanner = await new NodeClam().init({
|
||||
clamdscan: {
|
||||
host: this.configService.get<string>("CLAMAV_HOST", "localhost"),
|
||||
|
||||
Reference in New Issue
Block a user